API Status

Learn how to check the status of Lens API.


Health Check

You can use the ping query to check the operational status of the Lens API.

query {  ping}

API Version

Every API response includes an x-api-version header that indicates the current version of the API, which can be helpful for debugging purposes.

If the version of your React SDK significantly differs from the current API version, a warning will appear in your browser's developer console. To resolve this, simply update the SDK to the latest version.

Protocol Version

You can use the lensProtocolVersion query to retrieve the current version of the Lens Protocol's smart contracts.

query {  lensProtocolVersion}

Relayer Queue

The relay can occasionally become overloaded. To manage this, we continually add new relays to distribute the load and maintain balance. This query is useful for debugging, as it allows you to view the size of each queue if you notice any submission delays.

This API call can take 10-20 seconds if the cache is not used, as it needs to communicate with the defender, which can be slow. However, if the cache is used, the response is instant. This data is cached for 5-minute intervals.

If this call fails due to the Defender DB being unable to process it, simply retry. We advise against using this for production codeā€”it exists solely for queue visibility.

You can use the client.transaction.relayQueues method to inspect the size of the relay queue.

import { production, LensClient } from '@lens-protocol/client';
const client = new LensClient({  environment: production,});
const result = await client.transaction.relayQueues();