Skip to main content

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

count

Integer

Total number of items.

20

items

array:object

Array (list) of response objects.

page

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

rpp

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

cursor

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 page nor cursor is specified, cursor-based pagination is assumed. This parameter cannot be used together with page.

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.
Included fields are count, items, page, rpp, and cursor.

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.