Instagram api not-working - instagram

I trying to use instagtram api. But endpoints: comments and likes not working.
https://www.instagram.com/developer/endpoints/comments/
But if I try to get comments - Data is empty.
What`s wrong?

Instagram API after Jun'16 is so unusable.
Try fetch this https://www.instagram.com/query/?q=ig_shortcode(BK07W-Xhq6S){comments.last(20){count,nodes{id,created_at,text,user{id,username,full_name}},page_info}} and you receive JSON with comments data.

Related

How can I use nested includes with the Football API? (SOLVED)

I'm trying to enrich my API response with includes using the sportmonks.com football API. Here is the documentation: https://sportmonks.com/docs/football/2.0/leagues/a/get-by-id/7
However, it seems like it doesn't work with my request:
https://soccer.sportmonks.com/api/v2.0/leagues/2?api_token=MYTOKEN&include=season&fixtures
How can I enrich this response with all the fixtures of a season?
I've solved the issue. Instead of season&fixtures, I should've used season.fixtures. Thanks for the help guys!

Instagram Hashtag Search API returns error message "user_id is required" although I have provided it

I am trying to get data about media from my IG Business account with a specific hashtag.
I used Graph API Explorer and tried with
/{hashtag_id}?user_id={instagram_business_id}&fields=recent_media
but I got an error "(#100) The parameter user_id is required."
Does anybody know what may be the problem and how to solve it?
The API URL is incorrect, your URL should look like this:
/{hashtag_id}/recent_media?user_id={instagram_business_id}&fields=id,caption,media_url...

How to retrieve all images from multiple photo post on Instagram

Recently Instagram announced support for multiple photos post.
I tried with endpoint, GET /media/media-id, but response has information about only one image.
Anyone is able to retrieve all images from single multiple photo post using their API?
Thanks.
Not available in official API yet, but you can use the "Instagram Photo Page URL" and add ?__a=1, this will give you JSON with all the multi-images in it.
For example:
https://www.instagram.com/p/BQ00n_BB7Dm/?__a=1
You will get JSON response with media.edge_sidecar_to_children.edges[] will have all media urls and info
Instagram API now supports the "multi photo" posts.
If a post is of type "multi photo", in the API the "type" property will now be with the value "carousel" and the "mediaData" property will contain "carousel_media" property with an array of the images (posts).

Twitter API get Parameters after Oauth

I'm using Allauth for Twitter, works like a charm.
I have never worked with Scopes, so my question is, is there any support to get for example the twitter user stream?
Or anyone got any ideas how to get the request working?
I'm struggeling with the twitter api, it seems way more complicated then facebook or foursquare or any other api i have come across.
with facebook it's like this
return requests.get("https://graph.facebook.com/v2.3/%s&access_token=%s" % (path, access_token)).json()
Now if i send
requests.get('https://api.twitter.com/1.1/statuses/home_timeline.json&oauth_consumer_key=' +oauth_con+ 'oauth_signature_method="HMAC-SHA1"&oauth_nonce="'+now+'"&oauth_token="'+twitter+'"&oauth_timestamp="'+now+'"&oauth_version=1.1"')
I get a either a 400 error or a 404 error depending on .json? or json&.
According to the doc you have to have "" around every parameter. Didn't help.

Pagination info missing in instagram api

I am using the most popular api via instagram api
In the document, it saying something about pagination and next_url but when I
use the link below with my app ID. I don't see any pagination info in the json.
Am i missing something?
https://api.instagram.com/v1/media/popular?client_id=CLIENT-ID
or
https://api.instagram.com/v1/media/popular?client_id=CLIENT-ID&count=10
you should get the pagination info back in a an object callged "pagination"
"pagination": {
"next_max_tag_id": "1335465136530",
"deprecation_warning": "next_max_id and min_id are deprecated for this endpoint; use min_tag_id and max_tag_id instead",
"next_max_id": "1335465136530",
"next_min_id": "1335465556125",
"min_tag_id": "1335465556125",
"next_url": "https:\/\/api.instagram.com\/v1\/tags\/cats\/media\/recent?callback=jQuery17201362594123929739_1335440328560&_=133544032857&client_id=xxx&max_tag_id=1335465136530"
}
Which has the next_url you are looking for
The pagination information will be empty if the requested user's feed has fewer posts than the default query count. In other words, if the instagram account only has five pictures, there is no pagination info.
There is not a lot of documentation around pagination on the official API.
Check out this tutorial for more guidance and depth.
http://eduvoyage.com/search-instagram-pagination.html
You need to use the "min_tag_id" and "max_tag_id" to get the images you want.
As your using the endpoint to get popular images, you might want to try something like this.
https://api.instagram.com/v1/tags/cats/media/recent?callback=?&client_id=YOURID&max_tag_id=1364206789229
But if you are after a specific tag, try something like this.
https://api.instagram.com/v1/tags/cats/media/recent?callback=?&client_id=YOURID&max_tag_id=1364206789229
media/popular endpoint does not have a pagination object. As Ryan Ore explained some endpoints provide pagination and some dot not.
You check whether the endpoint has a pagination or not by "pagination": {} object. If the object exists the endpoint has pagination.

Resources