Authentication

Authentication for the OPENFORMAT API involves the use of an API Key, which is a secure credential that is tied to a specific Ethereum account address. This key should be included in the header of the request.

--header 'X-API-KEY: <OPENFORMAT_API_KEY>'

It is advised not to hardcode your credentials in a file in production environments. Use environment variables instead.

API Endpoints

OPENFORMAT provides a multitude of API endpoints that enable a variety of functionalities. the base URL for the the OPENFORMAT API is https://api.openformat.tech.

For instance, to get leaderboard data, the endpoint to use would look like this https://api.openformat.tech/v1/leaderboard.

Generating an API Key

You can generate an API Key in the API Reference. The process involves two steps: challenge and verify. As mentioned, an API Key is associated with a specific Ethereum account address. To achieve this, you must generate a challenge, sign it with your account address, and then verify the signed challenge.

We’ve developed a signing tool for signing messages with Metamask. If you prefer to sign messages locally, you can use the following scripts:

Transaction Lifecycle

We recommend reading and understanding the Transaction Lifecycle before continuing.