Design & Error Code
API Design
1. Path
Nodit Web3 Data API paths follow a common structure as shown below.
/{version}/{protocol}/{network}/{API resource}
//EXAMPLE: /v1/ethereum/mainnet/accounts
version: Specifies the API version. (e.g., v1)protocol: Specifies the protocol of the target blockchain environment.network: Specifies the network of the target blockchain environment.resource: Defines the resource for each API in a hierarchical structure.
2. Listing & Paging
When an API response includes list-type data, the count and items fields are used to distinguish the size and contents of the list. Most list responses support query parameters for pagination. Refer to the table below for parameter details.
Property | Type | Description | Example Value |
|---|---|---|---|
| Integer | Total number of items. | 20 |
| array:object | Array (list) of response objects. | |
| Integer | Page number for list pagination. Supported as a query parameter to retrieve results starting from a specific page. Accepts an integer between 1 and 100 (inclusive). Invalid values are ignored. Defaults to 1. | 1 |
| Integer | Number of result items to return per page during pagination. Accepts an integer between 1 and 100 (exclusive upper bound). Defaults to 20. | 20 |
| string | The cursor parameter is used for pagination and supports navigation between previous and next pages. Providing the cursor value from the previous response in the next request loads the following page of data. If neither |
3. Response Format
All Nodit Web3 Data API responses return data wrapped inside an object. Responses that return multiple items include a pagination field.
Key | Value Description |
|---|---|
pagination | A value from section 2 (Listing & Paging) that distinguishes the size and contents of the response. |
For successful responses (HTTP status code 2XX), the actual response object is returned in the response body in domain response format.
Key | Value Description |
|---|---|
data | The result data object for the request. |
For non-successful responses, a message field is included in the response along with a code field. It contains a description of the error that occurred.
Key | Value Description |
|---|---|
message | A descriptive message explaining the error. |
Response examples for both success and failure cases are as follows.