Google Finance API - - google-api

In google finance, I cannot get the stock low, stock high and few other information. Is there a way to get the same?
For example: http://finance.google.com/finance/info?q=NSE:AIAENG
Above link is giving very limited information like stock name, last traded price & time, change, change percentage How can i get stock low and high for the day using google finance.
Note : I tried using Yahoo Finance API but it is not working for Indian stock whereas it is working fine for NASDAQ and other exchange. So please suggest if I can use any other site API to get the necessary info of a stock

I had the same experience, plus both Google and Yahoo APIs can't be used for commercial purposes (https://groups.google.com/d/msg/google-finance-apis/dcKPEcDxDpU/IxBtLL7s8psJ). But I've found Alpha Vantage a great alternative, just need to follow their documentation (which is very simple) to get a JSON.
An example of getting a JSON output in PHP:
$url = file_get_contents('https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&outputsize=full&symbol=AAPL&apikey='.$apiKey);
$decoded = json_decode($url, true);

Related

YouTube V3 api returns considerably different LIKEs and Comments results from numbers on the Web

YouTube v3 api returns significantly different LIKEs count from what is on the web version of YouTube.
Compare these:
https://monosnap.com/file/EdtDNTTGDK06zoCZ7IXkMdzn6WuyOo
https://monosnap.com/file/CcJOiKl9CBMyncHQSrPv3lkLOuqeDD
To replicate:
https://www.googleapis.com/youtube/v3/videos?id=jWnhFM1Ttwg&key={api_key}&maxResults=50&part=statistics (https://console.developers.google.com/apis/credentials - use your Youtube V3 key)
Any ideas?
Many thanks!
Since I don't have any documentation (from the YouTube Data API v3) that backs me up for what I going to say, I'll drop some thoughts about why the API returns different values in the "likeCount" section comparing to the YouTube actual video (saw in the main website):
I think that the differences in the results returned by the API and the results shown in the website are due to:
YouTube has its own calculations for set the values in the website, the API results and in the YouTube Analytics1.
It would be possible that those additional "likes" retrieved in the API aren't exposed to the calculations made by YouTube.
1 Extracted from this answer in the Google Support webpage:
The number of likes/dislikes in YouTube Analytics may be different than what you see on the watch page under the video. This
is a known issue and our team is working to fix this. In the meantime,
please refer to the counts on the watch page under the video for the most accurate count.
And
In rare instances, you might see more likes/dislikes than views since these metrics are adjusted by different verification
systems.
For the specific videoId you posted in your question, I did check at 2019-01-25 and the results were:
likeCount "by the API": 1341
likeCount "in the YouTube website": 851
Check again at 2019-01-28 the numbers did changed:
likeCount "by the API": 1367
likeCount "in the YouTube website": 877
You can try here the API request for get these results - (results for current day).
If you make a substract from the likeCount values gotten above, you'll get 26.
Maybe it is futile try make any mathematical operation for set the "correct" value shown in the YouTube website (using the likeCount result from the YouTube Data API), but if anyone want give it a try, I encourage you to share your answer.

Get property rating from Booking.com API

I need to get the rating value from Booking.com system for specific property. Is there an API that provides information such as overall rating and other useful information for properties that are listed in their system?
In case anyone has the same question I will answer in short - the booking.com API is not public! In order to get access you need to write them an email and provide a lot of information about why you're going to use it, how and who is going to use it. Describe your business model etc. Also you need to producing an average of 500 bookings per month. Then wait an approval process.
I decided to simple parse the website and get the overall rating.

How do I find the current temperature of a city with NCDC API v2?

I'm a beginner with APIs but I feel this one is still a bit more vast and complex.
I want to find the air temperature of Boston. Or really, output any useful weather data.
Using this URL in JSON I can find the location of Boston:
http://www.ncdc.noaa.gov/cdo-web/api/v2/locations/CITY:US250002
Response:
{"mindate":"1885-01-01","maxdate":"2015-07-25","name":"Boston, MA US","datacoverage":1,"id":"CITY:US250002"}
Using this I can find the data category of "Air Temperature":
http://www.ncdc.noaa.gov/cdo-web/api/v2/datacategories/TEMP
Response:
{"name":"Air Temperature","id":"TEMP"}
This gives me no helpful information, so here is my effort to combine the two:
http://www.ncdc.noaa.gov/cdo-web/api/v2/datacategories/TEMP?locationid=CITY:US250002 (Air Temperature in Boston)
Response:
{"name":"Air Temperature","id":"TEMP"}
Normally when I enter an API all the information is there and available to filter via parameters. Here it seems the data is all divided. It will show you all the locations, all the data sets, all the categories that exist in the API, but how do I see the actual meat of the data? Ex. Current water temperature of Chicago, IL? Air Temperature on 3/14/2014 in Los Angeles, CA?
Here's my jsfiddle I'm using:
http://jsfiddle.net/f98dauaz/1/
You need to use a different endpoint, that endpoint I believe is just used for locations if you are looking for a location and data on that location itself.
You would need to pull from the data endpoint instead of the location endpoint, which you can find info on here http://www.ncdc.noaa.gov/cdo-web/webservices/v2#data
an example would be:
http://www.ncdc.noaa.gov/cdo-web/api/v2/data?datasetid=GHCND&datatypeid=TMAX&datatypeid=TMIN&locationid=ZIP:(zip_code_here)&limit=(your_data_limit_for_file)&startdate=(YYYY-MM-DD)&enddate=(YYYY-MM-DD)
Note this is for historical data not for current data

Is it possible to get invoice/billing data using Facebook Ads Api?

Can't find any information about invoices/billing in Facebook Ads Api documentation.
Is it possible at all to get Facebook ad account invoice data using any api?
I know I can get amount spent by ad account per day. Unfortunatelly this is not always identical to the amount on the invoices.
Unfortunately I don't think there is an API for this.
Spend is a little tricky to get right. Facebook can retroactively change the numbers, apply credits to your account, and so on, so you can't really rely on any spend numbers retrieved via the API being 100% accurate.
We ended up setting up a task that runs every night and retrieves spend data for the past 28 days. This was the only way we could ensure that our numbers matched FB's exactly. If you require a similar level of accuracy you might want to consider setting up something along those lines.

Exhaustive Search on Google Places

I'm trying to use Google Places API for a business locator app, but am having trouble creating an exhaustive database of business.
1.The API call only returns 20 results back.
2.The "type" restriction (e.g. type=restaurant) does not pick up all businesses by type in a given zip. I could use "keyword" but not all restaurants have restaurant in their name, and not all spas have "spa" in their name.
3. Each call produces the same set of results from day to day, and with only 20 returns per call, how am I to get a more exhaustive database of businesses?
I can try to get around the above three constraints by looping through a very well degraded search of businesses: say by zip code, some list of keywords, category type. But I still won't get close to picking up the 50 million or so businesses in google places.
In fact, even when I make a call for restaurants and bars in my own neighborhood, I don't pick up popular places down the block from me.
How is the API usable for an app that locates places then?
Any suggestions on how to create a more exhaustive search?
Thanks,
Nad
I'm not able to answer your question regarding Google Places API.
But for your requirements ('business locator app', 'I don't pick up popular places down the block from me') I suggest you try Yelp Search API:
Yelp's API program enables you to access trusted Yelp information in real time, such as business listing info, overall business ratings and review counts, deals and recent review excerpts.
Yelp is a popular review website with a capable API and you may test the quality of database and the devoted user base they have at Yelp homepage.
Note:
They keep some data for themselves and do not return everything in response.
The (free) dev account has a limit of 100 calls per 24 hours.
I know I'm late but maybe it helps someone these days.
By default, each Nearby Search or Text Search returns up to 20
establishment results per query; however, each search can return as
many as 60 results, split across three pages.
You need to use the field nextPageToken that you will receive on the first search to get the next page.
https://developers.google.com/places/web-service/search
An issue in stack overflow says:
There is no way to get more than 60 results in Places API. Some people
tried to file a feature request in Google issue tracker, but Google
rejected it with the following comment Unfortunately Places API is not
in a position to return more than 60 results. Besides technical
reasons (latency, among others) returning more than 60 results would
make the API be more like a database or general-purpose search engine.
We'd rather improve search quality so that users don't need to go so
far down a long list of results.
google places api more than 60 results
I faced the same difficulties that you did and decided to use the Yelp API instead. It is free, very complete and returns up to 1000 results. You should however check the terms of service before doing anything. It does not provide the website of the business (only the Yelp website link).
https://www.yelp.com/developers/documentation/v3/business_search
Other options I investigated at that time:
Foursquare ventures. (It was very expensive, and only returned up to around 100 results)
Here places API
Factual Places (I don't think this one is an API)
Sygic Travel API (Specific for touristical spots)
Planet.osm (OpenStreetMap)

Resources