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.
Related
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!
Is their any site where i can get fake JSON which have array of object related to store that include image price name so that I can improve my skill related to JSON GET,POST?
please any one suggest me site other then fake JSON placeholder
Thanks in advance
I used JSON BLOB to store JSON and creating links like APIs to teach my students.
Follow the steps to create JSON and get it over URL:
Create JSON into the editor
Click on the save button in the header.
You will get a link something like, https://jsonblob.com/e29c9fd2-13be-11e9-aac5-659aad2453a7
In the link replace https://jsonblob.com/ to https://jsonblob.com/api, in my case the new link will be https://jsonblob.com/api/e29c9fd2-13be-11e9-aac5-659aad2453a7
That's it! It will work like an API.
I recommend you to please once try fake-store-api .I have personally used this in my e-commerce projects.
I've been using String(contentsOfURL: NSURL) to retrieve the HTML file of a website (a post on Instagram like this one https://instagram.com/p/5FcnSATPa4/ in my case). I need some information about the post like how many likes the post has received or the location associated with the photo.
This line of the HTML file, for example, contains some of the info I need \"location\":{\"has_public_page\":true,\"name\":\"Kaputa\\u015f Beach\". The question is: how can I extract that "Kaputa Beach" name?
Thank you.
Why not use the actual Instagram API? https://instagram.com/developer/endpoints/likes/
Why spend time parsing the HTML when you get that information straight from the source.
You can authorise using OAuth (https://github.com/dongri/OAuthSwift)
You could retrieve a list of users who have liked an image using the call below, you can then derive the 'like' count from this:
https://api.instagram.com/v1/media/{media-id}/likes?access_token=ACCESS-TOKEN
Alternatively if you want more information on the media, you can use the following endpoint:
https://api.instagram.com/v1/media/{media-id}?access_token=ACCESS-TOKEN
Details here: https://instagram.com/developer/endpoints/media/#get_media
Here is an example of a swift app using the Instagram API, you can check out the project on GitHub to see how it works.
https://maniacdev.com/2015/01/example-a-swift-based-ios-instagram-photo-downloader-and-browser
EDIT:
You don't need to authenticate as a particular user to use the methods you need.
Login to instagram as yourself:
https://instagram.com/accounts/login/
Register a new client: https://instagram.com/developer/clients/manage/
Use your new client id with requests instead of your access token:
https://api.instagram.com/v1/media/{media-id}/likes?client_id={CLIENT_ID}
or
https://api.instagram.com/v1/media/shortcode/5FcnSATPa4?client_id={CLIENT_ID}
You can make up to 5000 requests per hour with your client id.
You can play around with the Instagram API here: https://apigee.com/console/instagram
Just remember to use your client id.
I tried to find the price of the items in the steam community market through the steam website by selecting View Page Info (Google Chrome) to locate the JSON page but with no luck.
NOTE I am trying to understand how to get the URL of the JSON page of the items in the steam community market and not to scrap the JSON page.
I have searched through StackOverflow and they seem to be able to get this URL with the JSON which I am unable to find.
//way number 1
http://steamcommunity.com/market/priceoverview/?currency=3&appid=730&market_hash_name=StatTrak%E2%84%A2%20P250%20%7C%20Steel%20Disruption%20%28Factory%20New%29
// way number 2
http://steamcommunity.com/market/pricehistory/?country=DE¤cy=3&appid=440&market_hash_name=Specialized%20Killstreak%20Brass%20Beast
You can use the priceoverview endpoint, just make sure you find the correct appid and market_hash_name.
You can easily locate needed values for these parameters by navigating to any Steam Market item listing.
For example, on this screenshot the appid is equal to 730 and the market_hash_name is AK-47%20%7C%20Redline%20%28Field-Tested%29.
The final parameter for request is currency, you can use the value of 1 for USD.
Finally, the request URL will look like this: http://steamcommunity.com/market/priceoverview/?appid=730&market_hash_name=AK-47%20%7C%20Redline%20%28Field-Tested%29¤cy=1
And querying it will yield the following JSON response:
{
"success":true,
"lowest_price":"$7.90",
"volume":"1,113",
"median_price":"$7.77"
}
You can also read more about the whole Steam Market parsing topic here.
I'm learning how to use a third party API called Wunderground and I don't know how to request, receive, and use their results which is in a Json format.
If you see their website a developer can sign up for free and receives an API KEY. You can then request weather data in the following URL format.. http://api.wunderground.com/api/KEY/FEATURE/[FEATURE…]/[SETTING…]/q/QUERY.FORMAT
So I have tried it in my web browser by typing some parameters and I received a very long Json file with the correct information (I checked). Problem is I don't have the slightest idea of how to create a variable which can make this request, and even if I was able to do that I don't know where should I receive the file and how to get only the results I want (in this case current weather).
You have to use Titanium.Network.HTTPClient to make request.
For code examples related to Json parsing you can use:
Appcelerator: Using JSON to Build a Twitter Client
HTTPClient()