This article describes some common parts for Loopring's REST API.

Base URL

Rate Limit

Each API has its rate limit settings. The relayer will reject all API invocations beyond this limit, with status code 429. Stop excessive API invocations to avoid your account from being suspended.

HTTP Headers


All API except querying user ApiKey need to specify the X-API-KEY HTTP header with the user's ApiKey as the value.


The following API needs to specify the X-API-SIG HTTP header to provide an EdDSA signature:

Setting HTTP Headers

To set the HTTP headers using Python, use the code below:

def init_request_session(apiKey, sig):
    session = requests.session()
        'Accept': 'application/json',
      'X-API-KEY': apiKey,
      'X-API-SIG': sig,
    return session


Except for network errors, all API will return the 200 HTTP status code and the result strucutre in json format. However, if an error occurred, besides the 400 HTTP status code, also there is a JSON structure which contains a resultInfo structure that has a code field for application-specific status code, and a data JSON object that represents API-specific response.


Field Type Required Description Example
resultInfo ResultInfo Y Result of API invocation -

ResultInfo Struct

Field Type Required Description Example
code integer Y Status code 0
message string Y Return message. This is used for debug only. Do not show to users "SUCCESS"

Status code

Status code Description
0 Success
100000 Unknown internal error
100001 Invalid parameter
100002 Request timeout
100202 Update fail
100203 Internal persistence error
100204 Duplicate request

results matching ""

    No results matching ""