Get image URL from google places web API (nearby search) - google-maps

when I run the following HTTP request:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?key=[API KEY]&location=${lat},${lng}&radius=400
..i get a response which is an array of objects (places)...each object has a key called photos (which is also an array of objects). I dont see a "getURL" method, so how do I get the image URL for the place?
Thanks

The Places API web service returns array of photos in the response. Each element in this array has a photo_reference field. So you can use the photo reference to get a photo using the following URL:
https://maps.googleapis.com/maps/api/place/photo?photoreference=YOUR_PHOTO_REFERENCE&maxwidth=600&key=YOUR_API_KEY
For further details have a look at the documentation:
https://developers.google.com/places/web-service/photos
I hope this helps!

Related

Can't get data from API endpoint

I'm trying to get cryptocurrencies logos from https://coinmarketcap.com
According to documentation I can get them from this endpoint /v1/cryptocurrency/info
It's also required that API Key should be supplied via a custom header named X-CMC_PRO_API_KEY.
I tried to make an API call in Postman, but it's returning bad request.
My key: X-CMC_PRO_API_KEY
My API Key value: c972ac08-519e-47e5-8cd8-23e6230289f3
I can fetch cryptocurrencies lists, but not metadata.
You also need to provide the cryptocurrency symbols for which you want the details symbol=BTC,ETH as part of the query. Refer screenshot below.
The logo key is present inside the respective cryptocurrency response.
"logo": "https://s2.coinmarketcap.com/static/img/coins/64x64/1.png"

Retrieve values from a nested response in Postman

I am using postman to get certain responses. Below is my response.
Here I have some other api request links integrated with this response. Is there any possibility that I can get values inside these apis also. Its like retrieve values forom both parent api request and child api request.
I know this is possible using a java code. But is there any other exsiting software that I can use for this?
In your case I would recommend combining multiple requests into a chain or even a workflow. The idea is to have the first request fetch href endpoints that get called in subsequent requests. For that, the initial request needs a post-request test script that reads the href values from the response and stores it in a environment or global variable.
Like so:
// persist project href for next request
pm.environment.set("projectUrlPath", pm.response.json().embedded.elements[0]._links.project.href);
Your next request in the line would than use this variable to build the request url. Like so:
http://www.example.com{{projectUrlPath}}
The key is to correctly navigate to the right attribute in the response json JavaScript object. This online tool might help you with that:
https://www.w3schools.com/js/tryit.asp?filename=tryjs_json_parse

Looking for json data that contains dota2 hero and item details

I am working on an application that get response from steam API. I am halfway through my task. Now I need some help on getting response of dota2 hero or item details that completely contains ìd name and image_url.
I want to know are there any steam API call to receive the response that I required?
Thanks in advance
You can use the following steam API call to get name, id and localized_name replace {ur_key} with the web API key that steam provided you.
https://api.steampowered.com/IEconDOTA2_570/GetHeroes/v0001/?key={ur_key}&language=en_us&format=JSON
But you need image URL too, you can use this json data of heroes and this data of items
I hope this would be helpful for you.

eBay API - get large thumbnail images with findItemsIneBayStores call

Does anyone know how can I get larger images with findItemsIneBayStores API call? I use JSON response and my request is following:
http://svcs.ebay.com/services/search/FindingService/v1?OPERATION-NAME=findItemsIneBayStores&SERVICE-VERSION=1.0.0&SECURITY-APPNAME=-DATA-FORMAT=JSON&REST-PAYLOAD&storeName=
Found answer.. I needed to add
&outputSelector=PictureURLLarge
to api call url

Google JSON/Ajax API - how do you get the next page of results?

According to : http://code.google.com/apis/ajaxsearch/documentation/#fonje
I get back a cursor result, but stupidly, the moreResultsUrl returns a URL NOT to the JSON service but to the main site - how do instead fetch the next page of results into JSON?
Well, that's because moreResultsUrl is pointing to http://www.google.com/search instead of http://ajax.googleapis.com/ajax/services/search/web.
What you need are just the parameters of the moreResultUrl which you can pass to http://ajax.googleapis.com/ajax/services/search/web for the JSON result.
For example:
http://www.google.com/search?v=1.0&q=Luca
is translated in JSON with
http://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=Luca
Google is just showing you their RESTful api, it's up to you to use the pages JSON value with whatever interface you want.