GET
/
v2
/
getBasechart
Get Base Chart Data
curl --request GET \
  --url http://localhost:2400/v2/getBasechart \
  --header 'Authorization: Bearer <token>'
[
  {
    "open": 123,
    "high": 123,
    "low": 123,
    "close": 123,
    "time": 123,
    "s": "<string>",
    "volume": 123
  }
]

Endpoint

GET /v2/getBasechart

Description

Retrieves historical price and volume data (Open, High, Low, Close, Volume, Timestamp) for a specified token address on the Base network within a given time range and resolution. It sources this data from the Defined.fi GraphQL API.

Query Parameters

ParameterTypeRequiredDescriptionExample
tokenAddressstringYesThe contract address of the token.0xTOKEN_ADDRESS
fromintegerYesThe start timestamp (Unix seconds) for the data range.1678886400
tointegerYesThe end timestamp (Unix seconds) for the data range.1678972800
resolutionstringYesThe chart resolution/interval (e.g., ‘1’, ‘5’, ‘15’, ‘60’, ‘D’, ‘W’, ‘M’).60
quoteTokenstringYesThe token used for quoting the price (e.g., ‘ETH’, ‘USD’).ETH
userIDstringYesThe ID of the user requesting the data (Usage context needs clarification).user-123

Success Response (200 OK)

Returns an array of bar objects.
Example
[
  {
    "open": 1500.50,
    "high": 1510.20,
    "low": 1495.80,
    "close": 1505.00,
    "time": 1678886400000, // Unix milliseconds
    "s": "ok", // Status from Defined.fi API
    "volume": 12345.67
  },
  // ... more bars
]

Error Response

Returns a JSON object with an error message.
Example
{
  "error": "Error message details..."
}

Dependencies

  • Relies on the Defined.fi GraphQL API (https://graph.defined.fi/graphql).
  • Requires a valid definedAPIKey configured in the server’s ./config.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Query Parameters

tokenAddress
string
required

The contract address of the token (e.g., on Ethereum or Base).

from
integer
required

The start timestamp (Unix seconds) for the data range.

to
integer
required

The end timestamp (Unix seconds) for the data range.

resolution
enum<string>
required

The chart resolution/interval.

Available options:
1,
5,
15,
60,
D,
W,
M
quoteToken
string
required

The token used for quoting the price.

userID
string
required

The ID of the user requesting the data.

Response

200
application/json

Successful retrieval of chart data

An array of OHLCV bar objects.