Skip to content

Instantly share code, notes, and snippets.

@ritik1009
Created December 7, 2022 07:17
Show Gist options
  • Save ritik1009/cb3b4ea79e63cd9dfa53bdfc4bd3926b to your computer and use it in GitHub Desktop.
Save ritik1009/cb3b4ea79e63cd9dfa53bdfc4bd3926b to your computer and use it in GitHub Desktop.
graph_url = 'https://graph.facebook.com/v15.0/'
def post_image(caption='', image_url='',instagram_account_id='',access_token=''):
url = graph_url + instagram_account_id + '/media'
param = dict()
param['access_token'] = access_token
param['caption'] = caption
param['image_url'] = image_url
response = requests.post(url, params=param)
response = response.json()
return response
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment