Upgrade amount of requests per minute 🔢
As the requested amount per minute is limited to prevent possibilities of DDoS attacks we offer three different levels of limits to best suit your project needs. All levels are completely free and this page covers a guide on how to acquire each one of them.
Standard user
As a standard user, you do not need to do any action and are free to use XCM API right away.
The limit for this level is: 20 requests per minute
Captcha verified user
To become a verified user you have to complete simple captcha verification.
Before you proceed with verification note the following:
- After you verify with the captcha you will receive your authentication token which you can use to unlock the higher request limit.
- This token is only visible once so make sure to save it properly.
- These tokens are not saved anywhere by us so we could not restore them for you.
You can claim your token on the following site (API has to be running):
http://localhost:3001/app/generate-api-key
The limit for this level is: 100 requests per minute
The verification website should look like this:
Your generated API key will be in the following box:
Higher request limit user
If 100 requests per minute is not enough for your project you can request a limit that will suit your needs.
Before you proceed with the request note the following:
- Freshly hashed and generated UserID associated with your captcha-generated API key will be stored in our database for simple monitoring (only request amount monitoring) to prevent malicious behaviour (You can find out the format of data we store in the deploy section).
- You will have to provide a few details (Your email address, the reason for the higher limit, the amount you wish to set as your limit and the token you received in captcha verification)
- Once your request is reviewed you receive an email response which will tell you if your request was accepted or rejected (with reason).
- If you already have your token implemented in your project you do not need to change anything, a higher API request limit will automatically start working.
Request for higher limit can be done in the following form (API and Database have to be running. Both need to be correctly configured):
http://localhost:3001/app/higher-request-limit
The limit for this level is: Per request
More on this feature can be found in the following Pull request
Form submit website should look like this:
Confirmation about successful form submission:
You should receive an email similar to this one:
Please verify that confirmation email comes from address info.lightspell@gmail.com
. This only applies to the official deployed version. If you plan on deploying your own XCM-API fork you can set a custom email address. More on this in the Deploy API yourself section.
Implement into dApp/REST API
REST API Client
This guide shows how to implement token into API Client (Insomnia in this case) There are 2 ways.
The first is to implement the key into the API-KEY section.
The second way is to implement the key into the HEADERS section.
Make sure to name the key as X-API-KEY
otherwise your key won't be recognized.
In-app token integration
The following snippet can be observed. See the Headers
section where the API key is inserted.
const response = await fetch(
'http://localhost:3001/x-transfer?' +
new URLSearchParams({
//Method parameters should be here
//For eg. from: 'Basilisk'
}),
{ headers: new Headers({ 'X-API-KEY': '<API_KEY>' }) }, //This is where you implement your API token
);
As observed in the above snippet, adding the following line to fetch requests allows for updating the request count per minute.
{ headers: new Headers({ 'X-API-KEY': '<API_KEY>' }) }, //This is where you implement your API token