Skip to content

Instantly share code, notes, and snippets.

@ritik1009
Created September 30, 2022 17:37
Show Gist options
  • Save ritik1009/ef6020951f2ae2a231b3e83114889c47 to your computer and use it in GitHub Desktop.
Save ritik1009/ef6020951f2ae2a231b3e83114889c47 to your computer and use it in GitHub Desktop.
def get_user_insights(access_token = '',api_url = '',ig_user_id = '',period = '',metric ='',since = '',until=''):
url = api_url + ig_user_id + '/insights'
param = dict()
param['metric'] = metric
param['period'] = period
param['since'] = since
param['until'] = until
param['access_token'] = access_token
response = requests.get(url=url,params=param)
print("\n response",response)
response = response.json()
print("\n response",response)
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment