Skip to main content
This example shows how an integrator can:
  • Fetch and cache Rialto’s supported-token snapshot.
  • Refresh the cache efficiently with an ETag.
  • Check token support locally before requesting a quote.
  • Report genuine demand for an unsupported token without entering a retry loop.

Requirements

The example requires Python 3.10 or later and the requests package:
Set your Rialto API key before running it:

Run the example

Save the complete example below as partner_supported_tokens_example.py. Then provide the sell token, buy token, and optional sell amount:
To send one genuine unsupported-demand probe when either token is absent from the local snapshot, add --report-unsupported-demand.

Complete example

The first refresh downloads the current snapshot and saves its ETag. Each later refresh sends that saved value in If-None-Match. On 304 Not Modified, keep using the existing snapshot and ETag. On 200 OK, replace the snapshot and save the new ETag returned in the response.