1

we can get a stock details in yahoo using the following url . but how can i get stock details using market cap value ,divideend value ,pe ratio ,pro rating instead of sending s=GOOG in the url

http://finance.yahoo.com/d/quotes.csv?s=GOOG&f=snd1l1yr

second thing i get chart data using the following url

http://chartapi.finance.yahoo.com/instrument/1.0/GOOG/chartdata;type=quote;range=5d/csv/

but how can i generate graph using the data

please help me ! i spent 5 days to find i cant find the solution . i posted this in some forums i cant get the answer.

3
Contributors
6
Replies
50
Views
4 Years
Discussion Span
Last Post by cereal
1

I see you can get data also as xml or as json, this last seems to be malformed, so here's an example based on xml output:

<?php
    $url = 'http://chartapi.finance.yahoo.com/instrument/1.0/GOOG/chartdata;type=quote;range=5d/xml/';

    $f = file_get_contents($url);
    $xml = simplexml_load_string($f);

    # print everything
    print_r($xml);

Since you get an object array you can print a specific node by adding the node name:

print_r($xml->series);

From here it should be easy to collect data and create a chart.

0

thank you very much , great quick reply other forum they are still didn't reply.but i have one doubt, i am having jquery chart is this data is enough to generate all graph like ohlc,candlestick,ect....

then

we can get a stock details in yahoo using the following url . but how can i get stock details using market cap value ,divideend value ,pe ratio ,pro rating instead of sending s=GOOG in the url

http://finance.yahoo.com/d/quotes.csv?s=GOOG&f=snd1l1yr

0

If I understand you want to get data by changing this link parameters:

http://finance.yahoo.com/d/quotes.csv?s=GOOG&f=snd1l1yr

I'm not sure you can manipulate it, because you will need an API specification in order to know which parameters you can use. The Yahoo Finance API from what I'm seeing right now, does not provide this kind of feature, but only RSS feeds, which are actually those you're already accessing from:

http://finance.yahoo.com/q?s=GOOG

Maybe you want to consider the Finance Badges: http://finance.yahoo.com/badges/

Edited by cereal

0

ok you r right , but i need to do a small website like yahoo finance showing updated information like screening , marketing ,graph and graph comparisions
means how can i do it . i need to generate a graph like comparing two stock datas , multiple graph(ohlc,candlestick,ect). show stock details depent upon diveend yeilds means where can i get accurate data and graph code and datas any guidence

0

Yahoo finance API is not available anymore. I have moved to MarketXLS after this change, much more reliable data.

Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.