Skip to main content

2.1 General Instructions

2.1.1 Access Address

Environment
Production environmenthttps://api.racent.com/

2.1.2 API Signature Authentication

The API uses an identity authentication mechanism based on API signatures to ensure the integrity and security of requests. A signature parameter must be included in every API call, and the server will verify the correctness of the signature.

Common Parameters

The following parameters must be included in the Query String of every API request:

Parameter nameParameter typeDescriptionExample value
access_keyStringAccount ID, used to identify the caller identity1000000059
signature_nonceStringUnique random number for signature, used to prevent replay attacks,
a different random value must be used for each request
2206561-6450-430e-8b0a-26980754c0de
timestampStringTimestamp of the request initiation (unit: seconds)1673418729
signature_versionStringSignature algorithm version, fixed at 1.01.0
signature_methodStringSignature algorithm, fixed at md5md5
signatureStringThe signature value of this request, calculated from other parameters and the secret key85ef54421c69edeb098c7b557c6c5cd5
Note:
  • access_key and AccessSecret (secret key) can be obtained from API Management - API Access Credentials after logging in.
  • signature_nonce It is recommended to use a UUID or a sufficiently random string to ensure uniqueness for each request.
  • timestamp Requests with a timestamp differing from the server time by more than a certain threshold (e.g., 5 minutes) will be rejected.

Signature Mechanism

Step 1: Construct the Canonical Request String

1. Parameter Sorting

Sort all common parameters (except signature) and interface custom parameters in ascending lexicographical order of parameter names.

2. Parameter Encoding

Encode the name and value of each parameter using UTF-8, and perform URL encoding following the RFC3986 rules:

  • Characters that do not require encoding: A-Z a-z 0-9 - _ . ~
  • Other characters (such as space, /, ?, =, etc.) must be encoded in the %XX format, for example, a space is encoded as %20
3. Concatenate Parameters
  • Connect the encoded parameter names and values with =
  • Connect all parameter pairs with &, maintaining the lexicographical order

The resulting string is called stringToSign.


Step 2: Construct the Signature String and Calculate the Signature

The signature calculation method varies depending on the request type, as described below:

GET 请求
signature = md5(AccessSecret + md5( HTTPMethod + stringToSign ))
POST / PUT 请求(含 Body 参数)
signature = md5(AccessSecret + md5( HTTPMethod + stringToSign ) + md5( jsonStringToBody ))
Note:
  • HTTPMethod must be uppercase, such as GET, POST
  • jsonStringToBody is the raw JSON string of the request Body (spaces and line breaks must be removed, and fields must be sorted)
  • The + in the formula represents string concatenation and is not used for calculation

Parameter Encoding Rules (RFC3986)

Character TypeProcessing MethodExample
A-Z, a-z, 0-9, -, _, ., ~Do not encodeabc123abc123
SpaceEncoded as %20a ba%20b
Other ASCII charactersEncoded as %XX (hexadecimal)"%22

GET Request Example

Assumptions:

  • access_key = "1000000059"
  • AccessSecret = "19938c89c13ddf5da7636333a5aa4c0e"
  • signature_nonce = "iobzx72w63"
  • timestamp = "1755597512"

Step1: Construct stringToSign

access_key=1000000059&signature_method=md5&signature_nonce=iobzx72w63&signature_version=1.0&timestamp=1755597512

Step2: Calculate the signature

temp = md5("GET" + stringToSign)  // 结果为"9bc92e0f3e239dc628ebc416294422ba"
signature = md5(AccessSecret + temp) // 结果为"a33bdb81ea79eb4ebbac9da043309c00"

Final Request URL:

https://api.racent.com/api/v1/domain/tld?access_key=1000000059&signature_nonce=iobzx72w63&timestamp=1755597512&signature_version=1.0&signature_method=md5&signature=a33bdb81ea79eb4ebbac9da043309c00

POST Request Example (with Body)

Assume the Body is:

{"domain":"example.com"}

Its MD5 value is: 640c69595341436be9b0d1516d3d37ac

Step1: Construct stringToSign

access_key=1000000059&signature_method=md5&signature_nonce=abjipo5ar5a&signature_version=1.0&timestamp=1755598851

Step2: Calculate the signature

temp = md5("POST" + stringToSign)  // 结果为 "5aba63e4af1b7a4080eaf47d0fc56efe"
signature = md5(AccessSecret + temp + "640c69595341436be9b0d1516d3d37ac") // 结果为 "29487fd8ae5b828415d05b691caf015c"

Final Request URL:

https://api.racent.com/v1/domain/query-domain?access_key=1000000059&signature_nonce=abjipo5ar5a&timestamp=1755598851&signature_version=1.0&signature_method=md5&signature=29487fd8ae5b828415d05b691caf015c

2.1.3 API Rate Limiting

The default rate limiting rules for the same user accessing the same API are as follows:

  • 60 requests per minute
  • 500 requests per hour
  • 1000 requests per day

2.1.4 API Response Parameters

Parameter Description

Parameter NameParameter TypeDescriptionExample Value
dataObjectBusiness data; if the API returns an error, the value is null
codeIntError code; returns 0 on success, and the corresponding error code on failure0, 1000, 1001
messageStringError description information; returns "Success" when the API call is successfulover-rate-limit
errorsObjectFor some errors, more specific error descriptions will be provided through this field
request_idStringRequest ID, mainly used to assist in troubleshooting039ecdca-44d5-430f-8521-020f4953bcc5