Currencylayer Change API

Currency change (margin and percentage) analysis between two dates.

Documentation

Specifications

Code Examples

Schemas & Data

📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-schema/currencylayer-quotes-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-schema/currencylayer-currencies-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-schema/currencylayer-convert-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-schema/currencylayer-timeframe-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-schema/currencylayer-change-schema.json
📊
JSONSchema
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-schema/currencylayer-error-schema.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-structure/currencylayer-quotes-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-structure/currencylayer-currencies-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-structure/currencylayer-convert-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-structure/currencylayer-timeframe-structure.json
📊
JSONStructure
https://raw.githubusercontent.com/api-evangelist/currencylayer/refs/heads/main/json-structure/currencylayer-change-structure.json

Other Resources

OpenAPI Specification

currencylayer-change-api-openapi.yml Raw ↑
openapi: 3.0.3
info:
  title: Currencylayer Change API
  description: 'Currencylayer is a real-time and historical foreign exchange rate JSON API

    delivering bank-grade exchange rate data for 168 world currencies and precious

    metals, sourced from 15+ commercial-grade providers. The API is delivered via

    the APILayer marketplace and the legacy `apilayer.net` endpoint.


    Authentication uses the `access_key` query parameter on the legacy endpoint and

    the `apikey` HTTP header on the APILayer marketplace endpoint. The Free plan is

    limited to 100 requests per month and is HTTP-only with USD base; HTTPS,

    arbitrary base currency switching, and the `/convert` endpoint unlock on the

    Basic plan and above. The `/timeframe` endpoint requires the Enterprise plan

    and `/change` requires Enterprise Plus.

    '
  version: 1.0.0
  contact:
    name: Currencylayer Support
    url: https://currencylayer.com/contact
  license:
    name: Commercial
    url: https://currencylayer.com/terms
  termsOfService: https://currencylayer.com/terms
  x-provider: currencylayer
  x-parent: apilayer
servers:
- url: https://api.apilayer.com/currency_data
  description: APILayer-hosted production endpoint (current, HTTPS, apikey header)
- url: https://api.currencylayer.com
  description: Legacy currencylayer.com endpoint (HTTPS, access_key query, paid tiers)
- url: http://api.currencylayer.com
  description: Legacy currencylayer.com endpoint (HTTP, free tier)
security:
- ApiKeyAuth: []
- AccessKeyQuery: []
tags:
- name: Change
  description: Currency change (margin and percentage) analysis between two dates.
paths:
  /change:
    get:
      operationId: getChange
      summary: Get Currency Change Data
      description: 'Returns currency change parameters (start rate, end rate, absolute change,

        percentage change) between two dates for any supported currency pair.

        Available on Enterprise Plus plan and above.

        '
      tags:
      - Change
      parameters:
      - name: start_date
        in: query
        required: false
        description: Start date for the change window (YYYY-MM-DD). Defaults to yesterday.
        schema:
          type: string
          format: date
          example: '2005-01-01'
      - name: end_date
        in: query
        required: false
        description: End date for the change window (YYYY-MM-DD). Defaults to today.
        schema:
          type: string
          format: date
          example: '2010-01-01'
      - name: currencies
        in: query
        required: true
        description: Comma-separated ISO 4217 currency codes to report on.
        schema:
          type: string
          example: AUD,EUR,MXN
      - $ref: '#/components/parameters/Source'
      responses:
        '200':
          description: Per-currency change summary for the requested window.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChangeResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '429':
          $ref: '#/components/responses/RateLimited'
components:
  responses:
    Forbidden:
      description: The requested feature is not included in the current subscription plan.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid `apikey` / `access_key`.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Monthly request quota exhausted or per-minute rate limit hit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  parameters:
    Source:
      name: source
      in: query
      required: false
      description: 'Three-letter ISO 4217 source/base currency code. Defaults to USD on the Free

        plan; any source currency may be selected on Basic plan and above.

        '
      schema:
        type: string
        example: USD
  schemas:
    ChangeEntry:
      type: object
      properties:
        start_rate:
          type: number
        end_rate:
          type: number
        change:
          type: number
        change_pct:
          type: number
    ErrorResponse:
      type: object
      required:
      - success
      - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          properties:
            code:
              type: integer
              example: 104
              description: "Currencylayer error code. Known codes:\n  101 — Missing or invalid Access Key\n  103 — Non-existent API Function requested\n  104 — Monthly request allowance exceeded\n  105 — Requested function unavailable under current plan\n  106 — Query returned no results\n  404 — Requested resource does not exist\n"
            type:
              type: string
              example: monthly_usage_limit_reached
            info:
              type: string
              example: Your monthly API request volume has been reached. Please upgrade your Subscription Plan.
    ChangeResponse:
      type: object
      required:
      - success
      - change
      - start_date
      - end_date
      - source
      - quotes
      properties:
        success:
          type: boolean
          example: true
        terms:
          type: string
          format: uri
          example: https://currencylayer.com/terms
        privacy:
          type: string
          format: uri
          example: https://currencylayer.com/privacy
        change:
          type: boolean
          example: true
        start_date:
          type: string
          format: date
          example: '2005-01-01'
        end_date:
          type: string
          format: date
          example: '2010-01-01'
        source:
          type: string
          example: USD
        quotes:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ChangeEntry'
          example:
            USDAUD:
              start_rate: 1.281236
              end_rate: 1.108609
              change: -0.1726
              change_pct: -13.4735
            USDEUR:
              start_rate: 0.73618
              end_rate: 0.697253
              change: -0.0389
              change_pct: -5.2877
            USDMXN:
              start_rate: 11.149362
              end_rate: 13.108757
              change: 1.9594
              change_pct: 17.5741
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: APILayer marketplace API key (https://apilayer.com/marketplace/currency_data-api).
    AccessKeyQuery:
      type: apiKey
      in: query
      name: access_key
      description: Legacy Currencylayer access key (https://currencylayer.com/dashboard).