On this page

Usage

5.1 API Endpoints

  • '/extract/currency/:timestamp': Endpoint for triggering currency rate updates.
  • Description: This API endpoint retrieves currency and crypto exchange rates based on the provided timestamp.
  • Request Method: GET
  • Request Parameters: -- timestamp: The Unix timestamp for which currency and crypto exchange rates are requested.
  • Response: -- Currency Rates: Exchange rates for various currencies against USD. -- Crypto Rates: Exchange rates for cryptocurrencies against USD.

Sample Response:

Untitled
{
  "currency": {
    "forex": {
      /* Forex rates */
    },
    "crypto": {
      /* Crypto rates */
    }
  }
}
1
Copied!

URL: http://localhost:port/extract/currency/1707138422 Method: GET

Request Example

Untitled
GET http://localhost:port/extract/currency/1707138422
1
Copied!

Response Example

Untitled
HTTP/1.1 200 OK
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 2722
ETag: W/"aa2-xmwHpB0mzbCkT2NoIgnxTHD7rZI"
Date: Wed, 28 Feb 2024 12:16:35 GMT
Connection: close

{
  "currency": {
    "forex": {
      ...
    },
    "crypto": {
      ...
    }
  }
}
1
Copied!

Documentation:

Sample Usage:

Untitled
curl -X GET "http://localhost:port/extract/currency/1707138422"
1
Copied!

Postman Setup:

  • Open Postman.
  • Create a new request.
  • Set the request type to GET.
  • Enter the URL: http://host:port/endpoint
  • Click "Send" to execute the request.
  • You should see the response.

Alternative Curl Command:

Untitled
curl -X GET "http://{address}:port/extract/currency/1707138422"
1
Copied!