Jump to content

Check out our Community Blogs

Register and join over 40,000 other developers!

Recent Status Updates

View All Updates

- - - - -

Formatting Google finance API with JSON

for api json google google finance api json

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1 dukeu69


    CC Lurker

  • New Member
  • Pip
  • 6 posts

Posted 09 April 2015 - 10:39 AM





I'm trying to get live stock price feeds and format them into a program using JSON simple and I need to figure out how to format the output from that url. IN other words how to parse through it and get the proper data.


Like when I call geonames server for the Weather Observation object using this url:




it come out formatted nice and I know which fields to parse through to get what.


Anyone have any suggestions for adding the "$formatted=true" command to the google finance api call or something like that?

#2 dukeu69


    CC Lurker

  • New Member
  • Pip
  • 6 posts

Posted 09 April 2015 - 11:23 AM

or if anyone knows of a better api that i can call for live stock price changes of companies and it has to be compatible with JSON simple.

#3 BlackRabbit


    CodeCall Legend

  • Expert Member
  • PipPipPipPipPipPipPipPip
  • 3871 posts

Posted 10 April 2015 - 05:05 AM

You don't need to parse it. You just call the Json API and it will  parse it and return it as records.


Here is a small tut/sample for you.

#4 dukeu69


    CC Lurker

  • New Member
  • Pip
  • 6 posts

Posted 10 April 2015 - 05:10 AM

yes but in order to format the output I need to know the data types of each field. and cast them from type Object to String, Int, Double, whatever they may be in  order to override the Object class toString and have a formattable output. I know because I've done this with geonames server getting the weather observation object and parsing through the fields. 


I've actually found a better API. markitondemand gives you an API with great documentation about each fields datatype.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download