Overview
Fundamentals of LI.FI`s API.
Base URL
LI.FI’s API is built on REST principles and is served over HTTPS.
The Base URL for all API endpoints is:
Authentication
Authentication to LI.FI’s API is performed via the custom HTTP header x-lifi-api-key
with an API key. If you are using the Client SDK, you will set the API when constructing a client, and then the SDK will send the header on your behalf with every request. If integrating directly with the API, you’ll need to send this header yourself like so:
API key can be tested using the following endpoint:
x-lifi-api-key
in client-side environments such as browser-based JavaScript or direct Widget integrations. Using the API key on the client side can lead to unauthorized usage or abuse of your key, as it becomes publicly accessible in the browser’s developer tools or network tab.
If you’re using the LI.FI Widget, you do not need to pass an API key. The Widget operates securely without requiring a key in the frontend. For server-side integrations (e.g. SDK or API requests from your backend), always keep your key secret and secure. Rate Limit
Rate limit is counted per IP without API key and per API Key with authenticated requests.
Please refer to Rate limits and API authentication page.
Error Message
Errors consist of three parts:
- HTTP error code
- LI.FI error code
- Error message
Specific error codes and messages are defined on Error Codes page