Coder Social home page Coder Social logo

exchangerates's Introduction

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 and temperature rate exchange are 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. One more thing is that the rate fetched from google is cached by 10mins in this application.

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"
}
/currency?from=USD&to=LAK {
    "err": "not supported rate conversion."
}
/currency?from=MXV&to=USD {
    "err": "Parse error in query. - tokens = 1 MXV =? U.S. dollar"
}

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}

Help needed!

We've reached the GAE URL Fetch Quota for the currency API. And I need your help to enable billing to get larger quota. Do please help to click this link and donate me $1.00USD.

License

ExchangeRates is released under the MIT license:

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.