Skip to main content

Performance Optimization with Compression

To improve the efficiency and performance of data transfer, we enforce compression when interacting with our Market Data APIs. Using compression reduces the size of the data payload, allowing for faster fetch times and better bandwidth utilization.

Supported Compression Methods

Our API supports the following compression methods via the Accept-Encoding header:
  • gzip (default and recommended)
  • deflate
  • br (Brotli)

Benefits of Compression

  1. Faster Data Transfers: Smaller payloads reduce the time needed to fetch data, especially for endpoints returning large datasets
  2. Efficient Bandwidth Usage: Compression minimizes data transfer costs by reducing the volume of data sent over the network
  3. Broad Compatibility: Widely supported compression methods like gzip ensure compatibility across most HTTP clients
  4. Future-Ready: Prepares you for upcoming mandatory compression requirements

Implementation Examples

cURL

Python (Requests Library)

JavaScript (Fetch API)

Postman

  1. Go to the Headers tab in your request
  2. Add Accept-Encoding as the header key and gzip as the value
  3. Send the request and observe the compressed data being returned

Query Parameters

Some endpoints have optional query parameters which attach additional data in the response. Below is a comprehensive list of those parameters and their respective responses.

Validation Method

Query parameter: validationMethod All blockchain related endpoints have the option to return the necessary data used to prove the validity of the associated data returned with the response. Note: Only applies to endpoints that return block data

Example Response: Block Validation

Example Response: Transaction Validation

Include Price

Query parameter: includePrice Blockchain data endpoints have the option to include price data in the response.

Example Response

Currency

(To be used in conjunction with includePrice) Query parameter: currency Options: usd btc eth (These vary by endpoint) This option selects the currency type to be returned with the includePrice parameter.

Example Response

Page Parameter

Query parameter: page Options: 0 - ∞ Some endpoints contain the column names in the metadata instead of a next field to retrieve the URL of the next page of data. Therefore, you will need to use the page parameter to loop through all pages of data returned, which begins at page 0 for all endpoints where this query parameter is available.

Compression FAQ

We recommend using gzip, as it is widely supported and balances speed and compression ratio effectively.

Will compression impact my API usage limits?

No, enabling compression does not affect your API usage limits. It simply optimizes the data transfer process. If you encounter any issues while setting up compression, please contact our support team at support@amberdata.io.