Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1089709
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:15:56+00:00 2026-05-16T23:15:56+00:00

Currently, I try to get the data through YQL. select * from yahoo.finance.quotes where

  • 0

Currently, I try to get the data through YQL.

select * from yahoo.finance.quotes where symbol in ("BP")

I will get the XML respond.

I was wondering, in my Java application, is there any common used library I can use to parse the XML?

Or should I request the respond to be in JSON format? Then use JSONObject to parse it? Which one will be easier?

Here is the XML respond.

<?xml version="1.0" encoding="UTF-8"?>
<query xmlns:yahoo="http://www.yahooapis.com/v1/base.rng"
    yahoo:count="1" yahoo:created="2010-09-16T05:00:13Z" yahoo:lang="en-US">
    <diagnostics>
        <publiclyCallable>true</publiclyCallable>
        <url execution-time="2" proxy="DEFAULT"><![CDATA[http://datatables.org/alltables.env]]></url>
        <url execution-time="2" proxy="DEFAULT"><![CDATA[http://www.datatables.org/yahoo/finance/yahoo.finance.quotes.xml]]></url>
        <url execution-time="9" proxy="DEFAULT"><![CDATA[http://download.finance.yahoo.com/d/quotes.csv?f=aa2bb2b3b4cc1c3c6c8dd1d2ee1e7e8e9ghjkg1g3g4g5g6ii5j1j3j4j5j6k1k2k4k5ll1l2l3mm2m3m4m5m6m7m8nn4opp1p2p5p6qrr1r2r5r6r7ss1s7t1t7t8vv1v7ww1w4xy&s=BP]]></url>
        <url execution-time="11"><![CDATA[select * from csv where url=@url and columns='Ask,AverageDailyVolume,Bid,AskRealtime,BidRealtime,BookValue,Change&PercentChange,Change,Commission,ChangeRealtime,AfterHoursChangeRealtime,DividendShare,LastTradeDate,TradeDate,EarningsShare,ErrorIndicationreturnedforsymbolchangedinvalid,EPSEstimateCurrentYear,EPSEstimateNextYear,EPSEstimateNextQuarter,DaysLow,DaysHigh,YearLow,YearHigh,HoldingsGainPercent,AnnualizedGain,HoldingsGain,HoldingsGainPercentRealtime,HoldingsGainRealtime,MoreInfo,OrderBookRealtime,MarketCapitalization,MarketCapRealtime,EBITDA,ChangeFromYearLow,PercentChangeFromYearLow,LastTradeRealtimeWithTime,ChangePercentRealtime,ChangeFromYearHigh,PercebtChangeFromYearHigh,LastTradeWithTime,LastTradePriceOnly,HighLimit,LowLimit,DaysRange,DaysRangeRealtime,FiftydayMovingAverage,TwoHundreddayMovingAverage,ChangeFromTwoHundreddayMovingAverage,PercentChangeFromTwoHundreddayMovingAverage,ChangeFromFiftydayMovingAverage,PercentChangeFromFiftydayMovingAverage,Name,Notes,Open,PreviousClose,PricePaid,ChangeinPercent,PriceSales,PriceBook,ExDividendDate,PERatio,DividendPayDate,PERatioRealtime,PEGRatio,PriceEPSEstimateCurrentYear,PriceEPSEstimateNextYear,Symbol,SharesOwned,ShortRatio,LastTradeTime,TickerTrend,OneyrTargetPrice,Volume,HoldingsValue,HoldingsValueRealtime,YearRange,DaysValueChange,DaysValueChangeRealtime,StockExchange,DividendYield']]></url>
        <javascript execution-time="26" instructions-used="67513" table-name="yahoo.finance.quotes"/>
        <user-time>48</user-time>
        <service-time>13</service-time>
        <build-version>9128</build-version>
    </diagnostics> 
    <results>
        <quote symbol="BP">
            <Ask/>
            <AverageDailyVolume>38597700</AverageDailyVolume>
            <Bid/>
            <AskRealtime>38.25</AskRealtime>
            <BidRealtime>38.15</BidRealtime>
            <BookValue>27.294</BookValue>
            <Change_PercentChange>-0.34 - -0.88%</Change_PercentChange>
            <Change>-0.34</Change>
            <Commission/>
            <ChangeRealtime>-0.34</ChangeRealtime>
            <AfterHoursChangeRealtime>N/A - N/A</AfterHoursChangeRealtime>
            <DividendShare>2.52</DividendShare>
            <LastTradeDate>9/15/2010</LastTradeDate>
            <TradeDate/>
            <EarningsShare>-0.462</EarningsShare>
            <ErrorIndicationreturnedforsymbolchangedinvalid>N/A</ErrorIndicationreturnedforsymbolchangedinvalid>
            <EPSEstimateCurrentYear>6.14</EPSEstimateCurrentYear>
            <EPSEstimateNextYear>6.38</EPSEstimateNextYear>
            <EPSEstimateNextQuarter>1.38</EPSEstimateNextQuarter>
            <DaysLow>37.77</DaysLow>
            <DaysHigh>38.25</DaysHigh>
            <YearLow>26.75</YearLow>
            <YearHigh>62.38</YearHigh>
            <HoldingsGainPercent>- - -</HoldingsGainPercent>
            <AnnualizedGain>-</AnnualizedGain>
            <HoldingsGain/>
            <HoldingsGainPercentRealtime>N/A - N/A</HoldingsGainPercentRealtime>
            <HoldingsGainRealtime/>
            <MoreInfo>cnprmIed</MoreInfo>
            <OrderBookRealtime>N/A</OrderBookRealtime>
            <MarketCapitalization>119.6B</MarketCapitalization>
            <MarketCapRealtime/>
            <EBITDA>7.272B</EBITDA>
            <ChangeFromYearLow>+11.43</ChangeFromYearLow>
            <PercentChangeFromYearLow>+42.73%</PercentChangeFromYearLow>
            <LastTradeRealtimeWithTime>N/A - &lt;b&gt;38.18&lt;/b&gt;</LastTradeRealtimeWithTime>
            <ChangePercentRealtime>N/A - -0.88%</ChangePercentRealtime>
            <ChangeFromYearHigh>-24.20</ChangeFromYearHigh>
            <PercebtChangeFromYearHigh>-38.79%</PercebtChangeFromYearHigh>
            <LastTradeWithTime>Sep 15 - &lt;b&gt;38.18&lt;/b&gt;</LastTradeWithTime>
            <LastTradePriceOnly>38.18</LastTradePriceOnly>
            <HighLimit/>
            <LowLimit/>
            <DaysRange>37.77 - 38.25</DaysRange>
            <DaysRangeRealtime>N/A - N/A</DaysRangeRealtime>
            <FiftydayMovingAverage>37.8139</FiftydayMovingAverage>
            <TwoHundreddayMovingAverage>44.0511</TwoHundreddayMovingAverage>
            <ChangeFromTwoHundreddayMovingAverage>-5.8711</ChangeFromTwoHundreddayMovingAverage>
            <PercentChangeFromTwoHundreddayMovingAverage>-13.33%</PercentChangeFromTwoHundreddayMovingAverage>
            <ChangeFromFiftydayMovingAverage>+0.3661</ChangeFromFiftydayMovingAverage>
            <PercentChangeFromFiftydayMovingAverage>+0.97%</PercentChangeFromFiftydayMovingAverage>
            <Name>BP p.l.c. Common</Name>
            <Notes>-</Notes>
            <Open>38.08</Open>
            <PreviousClose>38.52</PreviousClose>
            <PricePaid/>
            <ChangeinPercent>-0.88%</ChangeinPercent>
            <PriceSales>0.42</PriceSales>
            <PriceBook>1.41</PriceBook>
            <ExDividendDate>May  5</ExDividendDate>
            <PERatio/>
            <DividendPayDate>Jun 21</DividendPayDate>
            <PERatioRealtime/>
            <PEGRatio>1.25</PEGRatio>
            <PriceEPSEstimateCurrentYear>6.27</PriceEPSEstimateCurrentYear>
            <PriceEPSEstimateNextYear>6.04</PriceEPSEstimateNextYear>
            <Symbol>BP</Symbol>
            <SharesOwned/>
            <ShortRatio>0.80</ShortRatio>
            <LastTradeTime>4:00pm</LastTradeTime>
            <TickerTrend>&amp;nbsp;+-+=+-&amp;nbsp;</TickerTrend>
            <OneyrTargetPrice>47.27</OneyrTargetPrice>
            <Volume>6831680</Volume>
            <HoldingsValue/>
            <HoldingsValueRealtime/>
            <YearRange>26.75 - 62.38</YearRange>
            <DaysValueChange>- - -0.88%</DaysValueChange>
            <DaysValueChangeRealtime>N/A - N/A</DaysValueChangeRealtime>
            <StockExchange>NYSE</StockExchange>
            <DividendYield>6.54</DividendYield>
            <PercentChange>-0.88%</PercentChange>
        </quote>
    </results>
</query>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:15:57+00:00Added an answer on May 16, 2026 at 11:15 pm

    I don’t think Yahoo provides a Java API. You’ll have to create an XML schema, then use an XML library to create entity classes (JAXB or similar). It’s also possible to get YQL data in JSON, in that case I’d use the Google GSON parser and create the entity class manually.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am currently try to retrieve a latitude and longitude value from a location.
I am currently using PIL. from PIL import Image try: im = Image.open(filename) #
I am trying to gather data from twitter and visualize it through Graphviz. I
I'm try to load data between lasst three years. i want to get data
I'm currently building an application where the user will generate data over time and,
I try to get some data about a city using Sparql query on DBpedia.
I currently try to use Reachability in iOS 5.1 on iPad. There is a
I'm currently (I try to) designing a RESTful API for a social network. But
I currently have MVS2008 and I want to try the 2010 version hoping that
I am currently using code similar to this: try { // IE ONLY var

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.