Swap History

This endpoint allows you to retrieve a list of swap transactions based on your General API Key. You can filter the results by various criteria, including time range, currency, and swap type (e.g., auto_convert, manual_swap, or swap_by_api). Pagination support lets you fetch the results in smaller, manageable sets for better control and efficiency.

get
Query parameters
track_idintegerOptional

Filter spesific exchange by it`s trackId.

typestring · enumOptional

Filter exchanges based on type.

Possible values:
from_currencystringOptional

Specify the currency symbol for filtering exchanges in a specific fromCurrency.

to_currencystringOptional

Specify the currency symbol for filtering exchanges in a specific toCurrency.

from_dateintegerOptional

The start of the date window to query for exchanges in unix format.

to_dateintegerOptional

The start of the date window to query for exchanges in unix format.

sort_bystring · enumOptional

Sort the received list by a parameter.

Default: create_datePossible values:
sort_typestring · enumOptional

Display the list in ascending or descending order.

Default: descPossible values:
sizeinteger · min: 1 · max: 200Optional

Number of records to be displayed on one page.

Default: 10
pageinteger · min: 1Optional

The page number of the results you want to retrieve.

Default: 1
Header parameters
general_api_keystringRequired

Your General API Key for authentication and authorization.

Content-TypestringRequiredDefault: application/json
Responses
200

Successful operation

application/json
get
import requests

url = 'https://api.oxapay.com/v1/general/swap/'

params = {
    'size': 20,
    'page': 1
}

headers = {
    'general_api_key': 'YOUR_GENERAL_API_KEY',
    'Content-Type': 'application/json'
}

response = requests.get(url, params=params, headers=headers)
result = response.json()
print(result)
{
  "data": {
    "list": [
      {
        "track_id": "393831199",
        "from_currency": "USDT",
        "to_currency": "BTC",
        "from_amount": 10,
        "to_amount": 0.0001054,
        "rate": 94876.66034156,
        "date": 1736508792
      },
      {
        "track_id": "315890329",
        "from_currency": "USDT",
        "to_currency": "BTC",
        "from_amount": 1,
        "to_amount": 0.00001052,
        "rate": 95057.03422053,
        "date": 1736503906
      }
    ],
    "meta": {
      "page": 1,
      "last_page": 1,
      "total": 10
    }
  },
  "message": "Operation completed successfully!",
  "error": {},
  "status": 200,
  "version": "1.0.0"
}

Last updated