add parameter to google query - php

I am trying to get the realtime stockquotes from google for some time now.
First I try'd the finance api, but that didd'nt work out.
Then I saw this query and it seems to good to be true
http://www.google.com/finance/info?client=ig&q=goog
It must have some drawbacks that I am not aware off now.
Anyway, it does give realtime, at least that what it is says on the google finance page
Does anyone know if I can add more parameters for the query like + YAHOO (this is falty)
so I can get more then one stock??
Also, is the output in json or do Y have to parse it differently?
I was planning to do this with curl and ajax
thanks, Richard

You can just add more ticker symbols with a comma, as in:
http://www.google.com/finance/info?client=ig&q=goog,msft
The response is indeed json. There is a good discussion on Stackoverflow about using the first-class Google Finance APIs to get stock quotes here:
How can I get stock quotes using Google Finance API?

comma seperate your sybols.
http://www.google.com/finance/info?client=ig&q=goog,osis

Related

google API (Geocoding) request returns wrong language

related to the doc https://developers.google.com/maps/documentation/geocoding/intro i am using this api request to figure out the full address data (especially lat/lon)
https://maps.googleapis.com/maps/api/geocode/xml?address=30449+hannover&sensor=false&language=en&key=YOURAPIKEY
the language parameter is the important part. its EN for english.
lets now face the result: "Niedersachsen" this part is german.
okay.. what a pitty.. i thought that google possibly doesnt know the english name of it so it returns the default german name since my request is about a german town but then i changed the api request a little bit and removed the ZIP (30449) of the address.
https://maps.googleapis.com/maps/api/geocode/xml?address=hannover&sensor=false&language=en&key=YOURAPIKEY
now my result was CORRECT: "Lower Saxony" in english.
so obviously google knows the name.
am I doing something wrong? do you have any ideas? i cant get this issue sorted...
please advise.
thanks!
p.s. its a little related to this I think: Google Geocoding API returns wrong language in response but not completely... I have also already opened a bug report on google side just in case...
I'm having Geocoding issues as well, ever since the new "pay-as-you-go" API nonsense. Installed new API key after activiating a new CC attached accnt with Google dev. Fixed things for a moment, but seems like cache issues are keeping the geocoding, as well as front side UX with the map embed itself (markers don't show, limited/no functionality). Wish I had an answer for you, but for now, just commiserating...

How to fetch stock details and key statistics from yahoo finance using php

As the question suggest can you please tell me how i can fetch details regarding stocks (current price,Market Cap,open price, bid price etc) and key statistical information such as Trailing P/E, Forward P/E,Profit Margin (ttm),Revenue Per Share (ttm),Book Value Per Share (mrq) etc. Can you also give a simple example/script (parsing Json/xml) for fetching these details. I want to fetch the details of this stock. Most of the tutorial for yahoo finance api in web is for C# and also vague regarding details. Ca
I would suggest the following posts and code sample on how to fetch stock prices from Yahoo! using PHP and json. This is by no means a complete solution just a baseline on how to go about it.
It is important that you at least try something and post you code because it makes it easier for the community to catch-on what you attempting.
PHP: How to get stock quote data from Yahoo! Finance? (Complete Code and Tutorial)
Now you have to take the result dataset from the PHP and encode it into json format which you can use on your front-end. For this part you might want to look at this link instead:
JSON Example to html table
There might be examples that explain or even provide a full solution to your problem but I that would require more research on your part. This is just to get you going!
Best of luck!
If you don't mind using the key statistics from BarChart.com, here is a simple function script:
library(XML)
getKeyStats <- function(symbol) {
barchart.URL <- "http://www.barchart.com/profile.php?sym="
barchart.URL.Suffix <- "&view=key_statistics"
html_table <- readHTMLTable(paste(barchart.URL, symbol, barchart.URL.Suffix, sep = ""))
df_keystats = html_table[[5]]
print(df_keystats)
}

Facebook Graph Api: How to disable transliteration from Cyrillic to Latin when querying FB Graph API

When searching with Facebook Graph API for posts containing a phrase in Cyrillic, it returns results containing the transliterated string.
For example when trying to get results for "стол":
https://graph.facebook.com/search?q=стол&type=post&...
I'm getting results for the transliterated string "stol".
Been there done that:
An old solution was to use the locale parameter. As it seems it is not working anymore in this kind of searches "by design".
Another proposed solution was to send Accept-Language headers with the query, but doesn't work either.
A workaround is to do an additional filtering after receiving the results, but it just doesn't seem to be a good practice.
So ... does anyone knows how to make Facebook Graph API search for exact phrase in given language without transliterating it?
Thanks!

Try to get List of Hospials using Google-places-api

i'm using this api below to find out nearest hospitals.In response json i'm not getting the contact number of those hospitals. how do i get that????
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=22.5531,88.3564&radius=500&types=hospital&sensor=false&key=AIzaSyBdBBjxmc51SAqsefefwgwtSyjxT6NPMUAtYA
You can get only thos info which is provided by the api. Please go through this link it has a nice explanation about the apis https://developers.google.com/places/documentation/search
I think, some of these APIs are closed, so i don't see a solution with Google APIs. Maybe geonames.org or OpenStreetMap gives you a better chance for the data you are looking for.
Overpass Turbo

is it possible to find geolocation using zipcode using PHP

Is it possible to find geolocation using zip code using PHP.
For example, if i am entering the zip code i need to find the name of that particular zipcode.
Is that possible? if yes kindly explain me how?
Thanks in advance
See the duplicate question on how to turn an address into coordinates using the Google Geocoding service.
A query in the format [zipcode], United States, e.g..
72116, United States
should always work for you.
Try maps.google.com to simulate the request.
The XML returned from the Google Service will contain the official place name, as well as other information like county and state names etc.
You can do this through Javascript and PHP using Google's Map API - check this question for an example of how this is used.
I dont think it can be done solely through PHP however because you'd need to access an API's data and they normally (not always) do this through javascript.
You should check the API documentation.
You can access the Geocoding API solely using PHP.. you don't even need an API Key anymore.
http://code.google.com/apis/maps/articles/phpsqlgeocode.html
So if understand this correctly, you want to know the City/State of the zip code you have entered?
Maybe you should look into the Access database here :
http://databases.about.com/od/access/a/zipcodedatabase.htm
And if you find it useful, just convert it into a MySQL table and use as you please.

Categories