GET
/
v2
/
getEthchart
Get Ethereum Chart Data
curl --request GET \
  --url http://localhost:2400/v2/getEthchart \
  --header 'Authorization: Bearer <token>'
[
  {
    "open": 1500.5,
    "high": 1510.2,
    "low": 1495.8,
    "close": 1505,
    "time": 1678886400000,
    "s": "ok",
    "volume": 12345.67
  }
]

Endpoint

GET /v2/getEthchart

Description

Retrieves historical price and volume data (Open, High, Low, Close, Volume, Timestamp) for a specified token address on the Ethereum network (Chain ID 1) 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 on Ethereum.0x6982508145454ce325ddbe47a25d4ec3d2311933
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’, ‘USDC’).ETH
userIDstringYesThe ID of the user requesting the data.user-123

Response

Returns an array of OHLCV (Open, High, Low, Close, Volume) data points:
[
  {
    "open": 1.23,
    "high": 1.25,
    "low": 1.22,
    "close": 1.24,
    "time": 1678886400000,
    "s": "ok",
    "volume": 1000.5
  }
]

Request Example

GET /v2/getEthchart?tokenAddress=0x6982508145454ce325ddbe47a25d4ec3d2311933&from=1678886400&to=1678972800&resolution=60&quoteToken=ETH&userID=user-123

Dependencies

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

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.