Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
397 views
in Technique[技术] by (71.8m points)

python - Instagram Graph API - Post an image

I'm trying to automate my instagram feed (in future extending to more users). To achieve that, im using:

  • Instagram basic display: to get access token for a certain user, permissions and then access to read-only data (followers, posts, etc). But this application does not support posting anything, just read operations.
  • Instagram graph API: I pretend to use this to actually post on instagram, but after reading the documentation and other questions in stackoverflow, i can't get any clue on how to post an image/video.

Also, as mentioned in the docs: share on news section it seems to be posible to post, but not from my app, it opens instagram app (which also shows compatibility with mobile apps only).

My last guess is that it's maybe posible by using facebook's graph API facebook's docs, where:

curl -i -X POST "https://graph.facebook.com/{your-page-id}/feed?message=Awesome!&access_token={your-page-access-token}"

it's used to post.

I've tried to use same format but on instagram's API:

curl -i -X POST "https://graph.instagram.com/{your-page-id}/feed?message=Awesome!&access_token={your-page-access-token}"

I got response from server (what gives me some hope that at least the endpoint exists) but it was an error response with unauthorized code.

Anyone knows how to post an image using the graph API? Is it even posible?

If you need any more info please ask for it in a comment!

Thanks!

question from:https://stackoverflow.com/questions/65886724/instagram-graph-api-post-an-image

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

It is now possible to POST contents (images, videos inclusive) to your instagram feed using Instagram Content Publishing API(Visit their website for more details).

There exist many restrictions/limitations for posting images as well:

  • Can only be used to publish to business IG User accounts; Creator IG User accounts are not supported.
  • Accounts are limited to 25 API-published posts within a 24 hour period.
  • JPEG is the only image format supported. Extended JPEG formats such as MPO and JPS are not supported.
  • Stories are not supported.
  • Shopping tags are not supported.
  • Branded content tags are not supported.
  • Filters are not supported.
  • Multi-image posts are not supported.

Publishing photos is a two-step process:


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...