Skip to content

paulkagiri/ExchangeRates

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Rate Exchange JSON/JSONP APIs

This is the rate exchange JSON/JSONP APIs project which is deployed at http://rate-exchange.appspot.com/.

Currently only currency rate exchange is supported.

Usage

Currency API

By invoking the currency API, just send a request to /currency as follow:

/currency?from=USD&to=EUR&q=1&callback=jsonpCallback

And note that the parameter q and callback is optional.

Here are some samples:

Request Response
/currency?from=USD&to=EUR {
    "to": "EUR",
    "rate": 0.77966630299999995,
    "from": "USD"
}
/currency?from=USD&to=EUR&q=2 {
    "to": "EUR",
    "rate": 0.77966630299999995,
    "from": "USD",
    "v": 1.5593326059999999
}
/currency?from=USD&to=EUR&callback=jsonpCallback jsonpCallback({
    "to": "EUR",
    "rate": 0.77966630299999995,
    "from": "USD"
})
/currency?from=USD&to=EUR&q=2&callback=jsonpCallback jsonpCallback({
    "to": "EUR",
    "rate": 0.77966630299999995,
    "from": "USD",
    "v": 1.5593326059999999
})
/currency?from=USD {
    "err": "invalid request"
}

Temperature API

By invoking the temperature API, send a request to /temperature as follows:

/temperature?mode=C2F&q=37

The mode can be C2F(Celsius to Fahrenheit) or F2C(Fahrenheit to Celsius). A jsonp callback parameter is optional. The response is as:

{"v": 98.6, "mode": "C2F", "qty": 37.0}

About

Rate exchange JSON/JSONP APIs

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published