2.1 General Instructions
2.1.1 Access Address
| Environment | |
|---|---|
| Production environment | https://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 name | Parameter type | Description | Example value |
|---|---|---|---|
| access_key | String | Account ID, used to identify the caller identity | 1000000059 |
| signature_nonce | String | Unique random number for signature, used to prevent replay attacks, a different random value must be used for each request | 2206561-6450-430e-8b0a-26980754c0de |
| timestamp | String | Timestamp of the request initiation (unit: seconds) | 1673418729 |
| signature_version | String | Signature algorithm version, fixed at 1.0 | 1.0 |
| signature_method | String | Signature algorithm, fixed at md5 | md5 |
| signature | String | The signature value of this request, calculated from other parameters and the secret key | 85ef54421c69edeb098c7b557c6c5cd5 |
access_keyandAccessSecret(secret key) can be obtained from API Management - API Access Credentials after logging in.signature_nonceIt is recommended to use a UUID or a sufficiently random string to ensure uniqueness for each request.timestampRequests 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:
signature = md5(AccessSecret + md5( HTTPMethod + stringToSign ))
signature = md5(AccessSecret + md5( HTTPMethod + stringToSign ) + md5( jsonStringToBody ))
- 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 Type | Processing Method | Example |
|---|---|---|
A-Z, a-z, 0-9, -, _, ., ~ | Do not encode | abc123 → abc123 |
| Space | Encoded as %20 | a b → a%20b |
Other ASCII characters | Encoded 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×tamp=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×tamp=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×tamp=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×tamp=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 Name | Parameter Type | Description | Example Value |
|---|---|---|---|
| data | Object | Business data; if the API returns an error, the value is null | |
| code | Int | Error code; returns 0 on success, and the corresponding error code on failure | 0, 1000, 1001 |
| message | String | Error description information; returns "Success" when the API call is successful | over-rate-limit |
| errors | Object | For some errors, more specific error descriptions will be provided through this field | |
| request_id | String | Request ID, mainly used to assist in troubleshooting | 039ecdca-44d5-430f-8521-020f4953bcc5 |