Why do I get the 'Oops' error from Instagram API location search (when using coordinates)? - api

I'm tring to search locations with the Instagram API in my application but also when testing with Apigee, I get 500 Internal server error, and Oops, an error occurred.
Apigee: https://apigee.com/console/instagram
Authenticate yourself and add this URL: https://api.instagram.com/v1/locations/search?lat=40.758896&lng=-73.985131
It should return Time Square locations. It worked a few times in the past, but currently it doesn't.
It would be an overkill to use the Foursquare api to search for locations, then pass the location id to Instagram. Is that the only way to get around this? Because once you know the location's ID it works ok.
My possible solution would be to let the user find the desired location here: http://worldc.am/id/47383924f964a520444c1fe3
And use the v2 foursquare API location ID for Instagram.

The Instagram API is pretty bad in that regards - it often just says "Oops an error occured!", without giving you any more info.
I believe their servers have a really low time out limit. Add the parameter distance=500, or even less, and you won't get this error any more. Basically, in a high density area (like a big city), you need to specify a small distance number, otherwise Instagram's server just times out while serving your request.

Related

Google maps geocoding returns empty string

Yesterday I created a new Google map geocoding API key on the developper console. I need to get gps coordinates from a server script. When I use the "which key do I need" in the console, it tells me I choosed the right key. I also allowed the fixed IP of my server in the key settings.
Now, when I use "https://maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&sensor=false&key=MY_KEY", it returns an empty string.
When I use "http//maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&sensor=false&key=MY_KEY" it returns a warning about this kind of queries must use https (which is consistent with the doc).
And finally, when I use "http//maps.googleapis.com/maps/api/geocode/json?address=MY_ADDRESS&sensor=false" (no https and no key) I get the relevant data, either in json or xml. As explained in the doc, this can be used with a limit of 2500 geocoding per day, but the problem is that I have different domains on the same server (with the same IP) that geocode, and since google tracks by IP to evaluate daily quotas...
So my question is : what am I missing when trying to geocode an address using https and the key ?
The only thing that crossed my mind is : do I need to activate billing in google maps, even though I know for sure that I will never exceed the free quota of 2500 queries per day, at least with the project to which the key is associated ?
Thanks in advance for any tip or advice.

how to display Google Plus average rating on my website?

I want to put Google+ badge of a business on my page. I can get code for it using Google Developer website: https://developers.google.com/+/web/badge/#badge
But i do not understand how to get average score and number of reviews so I can feature them on my website as well - something similar to what you get when you search for a place:
for example, here is a restaurant's Google+ page: https://plus.google.com/106659611775440325701/about?hl=en - it clearly displays all those reviews and scores. How to get this information from Google? Is there a way to modify badge's code to include them?
Reviews data is part of the Places API. There are a couple of options for getting them on your site.
The Maps Embed API would be the easiest but requires loading a map on your page.
Using the Maps JS API v3 you can load and render place details client side.
Using the HTTP API you can load details on your server to cache in a DB and render on page load.
UPDATE May 2019: it is possible now to get total number of reviews using Place Details Place APIs call: https://developers.google.com/places/web-service/details#fields
as of Jan 2019, it returns user_ratings_total field: https://developers.google.com/maps/documentation/javascript/releases#335
so looking at this again 3 years later, we still can't get all reviews for a place. We can get some - top 5 - using Place Details API call: https://developers.google.com/places/web-service/details
then there is a change request for Google team to extend this: https://issuetracker.google.com/issues/35825957
And finally, you can apply for Google Business Account and request access to extended API which allows you to get all reviews for a verified location: accounts.locations.reviews.list

What is the maximum results returned for YouTube Data API v3 call

Context
I am in the process of providing some consultancy on doing a HTTP GET using YouTube Data API V3; in order to develop a Windows based application to GET a list of results from Youtube, for say a specific CATEGORY, or a specific TAG.
We are open to using any programming language(I'm from a C++ background and am hoping You tube will support direct HTTP connections without using Google client SDK and so on) to connect to YouTube and (HTTP) GET data.(Once a month or so, so YouTube API quotas should not be problem).
The Issue
We are being told by some of my client's web developers that YouTube API v3 will only return a maximum of 500 records/results, for say a query that returns JUST the Total viewers, the Video's link, and basic meta data such as that.
S, say I wish to find 5,000 results for category "House music" or "basketball" - and I have the Developer Key etc are all set up, would that be possible?
If so, what GET fields would I need to populate(such as "max_results_per_page")?
Thank you.
The API won't provide more than ~500 search results for any arbitrary query. It's by design. Technically, it means that the nextPageToken field won't be returned once you hit ~500 results. No additional parameter can change that.
If you want more than ~500 results for a query, you have to split it into more specific sub-queries. I'd suggest using the publishedAfter and publishedBefore parameters to achieve that, but feel free to experiment with the other ones here.
This only holds for the search-Query. Other queries like "PlaylisItem:list" deliver more results. I have tested with 100.000 items to get the videos of a playlist.

Display venue public photo on iOS app

My apologies if I'm not using the most technical terms in my question as I am asking on behalf of a development team who is creating an app for me, but we are having trouble making a call to the Foursquare API to get public photos (at least one) of specific venues.
Until now they have only been able to get low resolution photos and are telling me we need to be authenticated but I'm not sure they are explaining what they need to me correctly.
I have searched for hours and have not been able to understand how we would be able to obtain at least one photo for a given venue. The closest I have come to is getting a list of photos for a venue using the example query: https://api.foursquare.com/v2/venues/43695300f964a5208c291fe3/photos?oauth_token=...TOKEN...&v=20130529
This involves the OAuth_Token and I had understood we didn't need this to get an image of a venue using the API.
Once again, apologies if I'm using any terms incorrectly as I am not a programmer myself. Thanks.
That call to venues/VENUE_ID/photos is indeed a way to solve your problem: you can do that to get public photos for specific venues, where the specific venue is identified by VENUE_ID. You don't need an OAuth token; instead, you can simply pass in client_id and client_secret parameters. Examine the URL pattern we document under "Userless access" here: https://developer.foursquare.com/overview/auth#userless
Once you have these responses, you need to construct a photo URL, and this is where you can specify the desired size. For each photo response, you take prefix + size + suffix to construct a full URL. For an example, see https://developer.foursquare.com/docs/responses/photo

Get A Users Over All Retweet and Mention Counts using Twitter API

We are working on some analytics using the amount a user is retweeted or mentioned... I can't seem to find a way to get these numbers using the apis does anyone have any ideas?
https://api.twitter.com/1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name={screen_name}&count={count}
it's important to include the line include_entities=true to the request. This will give you an expanded response including re-tweet and mention counts.
Get Status / User Timeline
Twitter API Console
Update:
to get tweets from the last 90 days, there is a Node.js library you can use called Snapbird
https://github.com/remy/snapbird
.. and here is another resource covering the same topic.
http://blog.tweetsmarter.com/twitter-search/10-ways-and-20-features-for-searching-old-tweets/