Unable to search media on the instagram API - api

I've been trying to use the "search" function of the media endpoint on the instagram API and it just answers a 500 internal error with the message "Oops, an error occurred.".
Here's the request I send to the API:
https://api.instagram.com/v1/media/search?lat=32.7157&lng=-117.165&distance=2000&access_token=xxx
I tried changing the distance, the latitude and longitude and choose another access_token, none of these changed a thing. Is it a problem with the current version of the API?

Related

Tweet with Twitter API "statuses/update" endpoint - text with brackets causes error

I use Twitter API v1.1 to do tweets with my application. All is working good, while I don't try to post text with "()" - in this case I got error:
"Error [32]: Could not authenticate you."
Does anyone know, how to screen brackets, and what is the full list of prohibited symbols for Twitter API "statuses/update endpoint?

Why doesn't the google plus user search api return any results?

I'm having trouble with the google plus API.
Trying to use the user search API, all it returns is a selflink and structure data.
What am I doing wrong?
And how can I use this API by only sending a HTTP request?

Instagram API - Getting invalid media id with video shortcode

I'm using the /media/shortcode/shortcode endpoint of instagram to get information about a certain media with a shortcode.
https://www.instagram.com/developer/endpoints/media/#get_media_by_shortcode
The problem is when I pass a photo's shortcode to the endpoint everything works fine and I get the result I'm expecting from Instagram, however, when I pass a video's shortcode to that endpoint, the api returns the following:
{
"meta": {
"code": 400,
"error_type": "APINotFoundError",
"error_message": "invalid media id"
}
}
Which does not make a lot of sense to me since the given endpoint should work just fine with videos.
I was running into this issue too---the Instagram documentation is not super clear, but this is because of the limitations of Sandbox mode.
To help you develop and test your app, the users and media available in Sandbox mode are real Instagram data (i.e. what is normally visible in the Instagram app), but with the following conditions:
Apps in sandbox are restricted to 10 users
Data is restricted to the 10 users and the 20 most recent media from each of those users
Reduced API rate limits
From https://www.instagram.com/developer/sandbox/.
TLDR you'll need to get your app approved to have your other API calls work.
The best and the easiest way to get the media info, either being photo or video is by calling this url (GET method) Insta Fetch Media URL
Sample code written in Python.
import requests, json
def get_media_id(image_url):
url = "https://api.instagram.com/oembed/"
querystring = {"callback": "", "url": image_url}
headers = {
'cache-control': "no-cache"
}
response = requests.request("GET", url, headers=headers, params=querystring)
return json.loads(response.text)

Cannot retrieve certain public tracks via SoundCloud API calls (403)

Some tracks in my playlist are not being returned when accessed via the SoundCloud API.
For example, here are two tracks in my playlist:
http://api.soundcloud.com/tracks/169170570?client_id=CLIENT_ID
http://api.soundcloud.com/tracks/251027701?client_id=CLIENT_ID
The URL for track 1 returns a JSON object and also appears properly in my /playlists request. However, track 2 gives me a 403 in the URL above and is not present in my /playlists request.
Why is this happening? As far as I can tell, track 2 is a public track and should be accessible. The interesting thing is I can still stream track 2 by adding /stream to the end of the URL:
http://api.soundcloud.com/tracks/251027701/stream?client_id=CLIENT_ID
What's going on here?
It's most likely that the artist has blocked API access to this track.
SoundCloud has introduced an option for right holders to disable all API access to tracks by default, returning this 403 error when requested
From:
SoundCloud API URLs timing out and then returning error 403 on about 50% of tracks

Instagram API for ADS posts not working

I get instagram post details (likes, comments) by using the media endpoint:
$data1 = file_get_contents("https://api.instagram.com/v1/media/$media_id/likes?access_token=$access_token");
This works for normal posts from my feed, but when I input the $media_id for an instagram post that is an AD I always get invalid media id
{
"meta": {
"error_type": "APINotFoundError",
"code": 400,
"error_message": "invalid media id"
}
}
Are ads treated as different types of posts or the API is unable to retrieve any details from them?
Yes, the ads are treated like a different type of post and can only be managed or fully read by means of the Facebook APIs. Try the Graph API, the Marketing API or the Business Manager API, that's where I got the most useful tips and results.
(sorry, dont have enough rep to post more than two links. But don't worry, you'll find it on google in a heartbeat)
Instagram ADS API has been integrated into Facebook Marketing API.
All the details are here: https://developers.facebook.com/docs/marketing-api/guides/instagramads/ads_management/v2.6
There is a workaround to get some details on an AD. If you query the oembed endpoint, like this: https://api.instagram.com/oembed/?url=https://www.instagram.com/p/BAZV-jVlFGp/ you get some data.
I wasn't able to get any comments though.