Instagram API 在本地工作但不在服务器上

Instagram API working local but not on server

我想用服务器调用instagram api。

我尝试在本地系统上执行以下操作:

curl https://api.coingecko.com/api/v3/coins/list   -->works perfectly
curl https://www.instagram.com/zitate.flx/?__a=1   -->works perfectly

在 linux 服务器上:

curl https://api.coingecko.com/api/v3/coins/list   -->works perfectly
curl https://www.instagram.com/zitate.flx/?__a=1   -->doesn't work

我的问题:为什么对 instagram API 的请求在我的本地系统上有效,但在服务器上无效?

import requests

def create_session():       
     cookie = {"name": "sessionid", "value":"{this is your session id}"}
     session = requests.Session()
     session.cookies.set(**cookie)
     return session

s = create_session()
response = s.get(https://www.instagram.com/zitate.flx/?__a=1)