Python Forum

Full Version: Instagram pagination tags
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am doing a development based on instagram, I do not use the API because they do not allow applications in development mode but in production mode.

So, I'm trying to get the following pages regarding a hashtag, for example:
Https://www.instagram.com/explore/tags/plebiscito/

The next page is done by sending a POST method, to a /query / and a /ajax/bz, however, trying to try it with cURL does not work for me.

I leave as I have been doing with cURL.

curl "https://www.instagram.com/explore/tags/plebiscito/" --http1.1 -k "https://www.instagram.com/query/" -H "Content-Type: application/x-www-form-urlencoded" -X POST -d "q=ig_hashtag(plebiscito)+{+media.after(j0hwe66aaaaaf0hwexjmwaaafkwa,+12)+{++count,++nodes+{++++caption,++++code,++++comments+{++++++count++++},++++comments_disabled,++++date,++++dimensions+{++++++height,++++++width++++},++++display_src,++++id,++++is_video,++++likes+{++++++count++++},++++owner+{++++++id++++},++++thumbnail_src,++++video_views++},++page_info}+}&ref=tags::show&query_id=/" --next --http1.1 -k "https://www.instagram.com/ajax/bz" -H "Content-Type: application/json" -X POST -d '{"q":[{"page_id":"7mj51x","posts":[["timespent_bit_array",{"tos_id":"7mj51x","start_time":1481556875,"tos_array":[3,0],"tos_len":2,"tos_seq":2,"tos_cum":19,"log_time":1481556876912},1481556876912,0]],"trigger":"timespent_bit_array"}],"ts":1481556877336}' --next -k "https://www.instagram.com/query/" -H "Content-Type: application/x-www-form-urlencoded" -X POST -d "q=ig_hashtag(plebiscito)+{+media.after(j0hwe66aaaaaf0hwexjmwaaafkwa,+8)+{++count,++nodes+{++++caption,++++code,++++comments+{++++++count++++},++++comments_disabled,++++date,++++dimensions+{++++++height,++++++width++++},++++display_src,++++id,++++is_video,++++likes+{++++++count++++},++++owner+{++++++id++++},++++thumbnail_src,++++video_views++},++page_info}+}&ref=tags::show&query_id=/" --next -k "https://www.instagram.com/ajax/bz" -H "Content-Type: application/json" -X POST -d '{"q":[{"page_id":"7mj51x","posts":[["timespent_bit_array",{"tos_id":"7mj51x","start_time":1481556875,"tos_array":[3,0],"tos_len":2,"tos_seq":2,"tos_cum":19,"log_time":1481556876912},1481556876912,0]],"trigger":"timespent_bit_array"}],"ts":1481556877336}'
Here I was trying to get page two, however, it responds with a page not found.

In short, I need to automate the pages with Python, but I was testing it with cURL.

Could you help me? thank you very much.
(Dec-12-2016, 06:53 PM)Kalet Wrote: [ -> ]I am doing a development based on instagram, I do not use the API because they do not allow applications in development mode but in production mode.

...then ask them how to develop.  If the production servers are not available while "developing", then they'll have development servers available.  And if they don't, then just use the production servers.

Unless the issue is the lib isn't available, in which case, this looks decent: https://github.com/LevPasha/Instagram-API-python