GithubHelp home page GithubHelp logo

apilayer / currencylayer-api Goto Github PK

View Code? Open in Web Editor NEW
106.0 14.0 42.0 1.07 MB

Reliable, accurate, real-time exchange rates for 168 world currencies, delivered in portable JSON format, compatible with any application. Full interactive documentation, code, integration guides and more available at https://currencylayer.com - Sign up for the Free Plan now!

License: Other

currencylayer-api's Introduction

Stay up to date by following @apilayernet on Twitter.

currencylayer JSON API

Currencylayer provides an easy-to-integrate REST API with real-time and historical exchange rates for 168 world currencies, by default relative to USD, delivered in lightweight and highly portable JSON format and compatible with any application.

Exchange rate data is collected from several major forex data vendors in real-time, bid/ask prices are blended algorithmically, validated, and delivered hourly, every 10 minutes, or even within the 60-second market window.

Providing the most representative forex market value available ("midpoint" value) for every API request, the currencylayer API powers currency converters, mobile apps and back-office systems all around the world.

Unique Approach

The online Forex API market is divided into two sections: Inexpensive, but unreliable open-source projects, and overpriced, but well-performing "Enterprise-class" APIs.

Currencylayer aims to combine the strengths of both into one superior product - delivering accurate, reliable and consistent currency exchange rates through a closely monitored API and making it accessible to small-scale businesses and startups - and conveniently low-priced for larger companies.

Sign up for free to get instant API Access.

Features & Integration

All real-time and historical exchange rates are available at https://currencylayer.com, along with 256-bit HTTPS encryption, JSONP Callbacks, HTTP Access-Control headers, HTTP ETags, and much more.

Long story short - the main API Functionalities are:

  • Real-time Forex data: Exchange rates for 168 world currencies and precious metals, with data updates ranging from every 60 minutes down to stunning 60 seconds

  • Historical Rates: Query the API for Historical exchange rates going back all the way to 1999

  • Currency Conversion Endpoint: Have the API convert one currency to another on your behalf, using real-time or even historical rates.

  • Time-Frame Queries: Request exchange rates between two specified dates, for timeframes of up to 365 days.

  • Currency-Change Queries: Request change parameters (margin and percentage) for one or more currencies, optionally between two specified dates.

  • Optional Parameters: Request a specific selection of currencies in order to reduce server load, query the API for a different Base Currency, and pretty print your JSON response.

Sign up for the Free Plan to get your API Access Key.

In-depth Documentation

Find a shortened version of the API's Documentation, along with a full Java Demo Source, in this Repository's docs folder.

Interactive example queries, a variety of code examples (including PHP/CURL, jQuery.ajax and Java), integration guides, useful downloads and much more is available at currencylayer.com/documentation.

Customer Support

Need any assistance? Get in touch with Customer Support.

Legal

All usage of the currencylayer website, API, and services is subject to the currencylayer Terms & Conditions and all annexed legal documents and agreements.

currencylayer-api's People

Contributors

macseem avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

currencylayer-api's Issues

historical API doesn't work

Using the historical endpoint:

http://apilayer.net/api/historical?access_key=MY_KEY&source=GBP&date=2018-09-20

always results in this error:

{"success":false,"error":{"code":302,"type":"invalid_date","info":"You have entered an invalid date. [Required format: date=YYYY-MM-DD]"}}

Problem with HTTPS encryption

I recently got a paid "Basic" plan for the API. In my code, I have to send the request to the API by creating string objects for the host, port number and target. When I tried setting the port number to 443, I got an HTTP response with nothing more than the "HTTP/1.1 200 OK" line. It's working correctly when the port number is set to 80. My web server code, where I'm doing this, is written in C++. If someone wants to it, is in this Gist: https://gist.github.com/DragonOsman/d00ea7ec3d49c128ad7789293f156a09 . I've put the port number for the request to the API for the conversion result (I'm querying the currency conversion endpoint) back to 80 for now.

Timestamp not rounded

Upon making an API request with my free account I get the below response.

The timestamp is 1434859633

Apparently if you convert from unix time to normal time its Sun, 21 Jun 2015 04:07:13 GMT. Since I'm on a free account shouldn't the timestamp be round numbers for hours? So it should read 04:00:00 GMT instead?

{
  "success":true,
  "terms":"https:\/\/currencylayer.com\/terms",
  "privacy":"https:\/\/currencylayer.com\/privacy",
  "timestamp":1434859633,
  "source":"USD",
  "quotes":{
    "USDUSD":1,
    "USDAUD":1.286646,
    "USDCAD":1.22655,
    "USDPLN":3.680374,
    "USDMXN":15.347704
  }
}

Currency rate for base currency seems wrong

I have just noticed that when I am getting a currency list with USD as the base, "USDUSD" is not 1.0 as expected but 1.0002680000. I do not know when this changed but it was brought to my attention recently. Can you explain why this could be? Here is a dump of the response.

{"terms":"https://currencylayer.com/terms","success":true,"privacy":"https://currencylayer.com/privacy","source":"USD","timestamp":1658071264,"quotes":{"USDEUR":0.99138,"USDGBP":0.843562,"USDCNY":6.757404,"USDAUD":1.471887,"USDSGD":1.399565,"USDCLP":1050.750396,"USDUSD":1.000268,"USDNZD":1.622982}}

Supported currencies failing

We currently are unable to fetch the VEF and GIP currencies.

Example:

https://api.currencylayer.com/live?access_key=xxx&source=VEF&currencies=EUR
https://api.currencylayer.com/live?access_key=xxx&source=GIP&currencies=EUR 

The response is "You have supplied an invalid Source Currency. [Example: source=EUR]"
We have tried to reach support but on the https://currencylayer.com/contact website, we get an error "Unable to create support ticket".

VUV missing from response

Today we noticed that a currency that used to be returned by a history GET is no longer returned. Vanuatu Vatu (VUV) is no longer in the response body. Just wondering if you could provide some visibility into why this currency is no longer reported as it is still listed under supported currencies.
The endpoint we're hitting is: https://apilayer.net/api/historical?access_key=[secret]&date=2022-07-12
I was not able to create a support ticket on the site so asking here.

Bug in currency service

I actually tried to open a support ticket about this right now, but I get an error saying the support ticket cannot be opened? So figured I would post it here:


Your currency service broke this morning and suddenly started returning a non 1.0 value for USD -> USD. Actually I think until now it never returned that in the response but today it started returning a non parity number of 1.000268. Now I know inflation is a bit nuts, but that is crazy :)

We had a bug on our end in that we were requesting rates against itself so it messed some stuff up on our end, so I will fix that. But you may wan to fix the service on your end.

{
success: true,
terms: "https://currencylayer.com/terms",
privacy: "https://currencylayer.com/privacy",
timestamp: 1657814824,
source: "USD",
quotes: {
USDUSD: 1.000268,
USDEUR: 0.996755,
USDGBP: 0.84608,
USDCAD: 1.31048,
USDPLN: 4.79665
}
}

[Feature Request] Add header with number of requests left

Here are the typical headers returned from the API:

Access-Control-Allow-Methods: GET, HEAD, POST, PUT, PATCH, DELETE, OPTIONS
Access-Control-Allow-Origin: *
Content-Type: application/json; Charset=UTF-8
Date: Wed, 14 Aug 2019 01:40:08 GMT
Etag: ed4e69176e1e5e6e50088c16cc4bc398
Last-Modified: Wed, 14 Aug 2019 01:33:05 GMT
Server: nginx
Transfer-Encoding: chunked
X-Apilayer-Transaction-Id: 5601092d-97f7-4b2d-a615-d10da23992da
X-Request-Time: 0.016

Could you please add one more header like X-Request-Quota: 99999 which would indicate the number of requests left till the next (monthly) reset?

This opens up a ton of possibilities like better incident investigation, or monitoring and alerts, etc.

TimeFrame strange response when date frame is future

Hi

When I try to ,make request with params

http://api.currencylayer.com/timeframe?start_date=2025-01-01&end_date=2025-12-31&access_key={{currencylayerToken}}&source=EUR

server return this response

Didn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis dataDidn't get redis data{"success":false,"error":{"code":106,"info":"Your query did not return any results. Please try again."}}

Quote: "USDUSD" is missing

Hello,

I noticed that in CurrencyLayer, the quote entry "USDUSD" is missing. It should have the value 1.
My OpenSource software relied on this value and due to the change at CurrencyLayers, the apps don't work anymore.
Can you please re-add it again? Thank you.

Best regards,
Daniel Marschall

PS: I tried to contact via https://currencylayer.com/contact but I get the error message "Unable to create support ticket.".

Live endpoint doesn't work when source=USD in query string

This started happening today when calling the api via https://www.apilayer.net/api/live?access_key="AccessKey"&source=USD&currencies=USD,AUD,MYR,GBP,ZAR,AED,CAD,NZD,SAR,TTD,PKR&format=1 I started to get the following response:

{\n "success":false,\n "error":{\n "code":201,\n "info":"You have supplied an invalid Source Currency. [Example: source=EUR]"\n }\n}"

When calling the same endpoint removing the source= in the query string which defaults to USD then it works fine and is using USD as source. Trying a different source like CAD returns successfully as well. Something seems to have occurred that has caused this endpoint not to work properly anymore

Bug in the "live" api.currencylayer API

Hello @macseem @paulzehetmayr,

It seems that there is a bug in the "live" api.currencylayer API:
When I request it using Postman:

GET https://api.currencylayer.com/live?access_key=XXXXXXXX&source=EUR&currencies=USD

It returns this Response:

{
    "success": false,
    "error": {
        "code": 302,
        "type": "invalid_date",
        "info": "You have entered an invalid date. [Required format: date=YYYY-MM-DD]"
    }
}

Any Idea ?

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.