html - Full Example of Coinbase API? -


i realize may asking lot api provide few lines. want see how put , call in html. think seeing full example me lot!

what know need: need request url

 $.getjson("https://coinbase.com/api/v1/prices/spot_rate?api_key=xxx" 

that provides validation need, accessing api( think). rest of code provide on site methods.

# reponse {   "amount": "10.00",   "currency": "usd" } 

so call in html use

<div id="call"></div> 

i'd appreciate help!

you can add &callback=? url shown in jsfiddle.

http://jsfiddle.net/8n7an/

$.getjson("https://coinbase.com/api/v1/prices/spot_rate?currency=usd&callback=?", function( data ) {     //do want response here }); 

otherwise, you'll run cross origin request issue require server side access fix.

so in case url be: https://coinbase.com/api/v1/prices/spot_rate?currency=usd&callback=?

i don't think need api key call. in fact, if you're doing in javascript/jquery, it's best not store api key on page since easy expose.

hope helps.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -