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

Endpoint

GET /v2/getSolchart

Description

Retrieves historical price and volume data (Open, High, Low, Close, Volume, Timestamp) for a specified token address on the Solana network (Chain ID 1399811149) 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 Solana.TOKEN_ADDRESS_SOL
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., ‘SOL’, ‘USDC’).SOL
userIDstringYesThe ID of the user requesting the data (Usage context needs clarification).user-123

Request Example

GET /v2/getSolchart?tokenAddress=TOKEN_ADDRESS_SOL&from=1678886400&to=1678972800&resolution=60&quoteToken=SOL&userID=user-123

Response Example (200)

{
  "status": "success",
  "data": [
    {
      "timestamp": 1678886400,
      "open": 23.45,
      "high": 24.10,
      "low": 23.10,
      "close": 23.90,
      "volume": 1200.5
    },
    {
      "timestamp": 1678886460,
      "open": 23.90,
      "high": 24.00,
      "low": 23.80,
      "close": 23.95,
      "volume": 800.2
    }
  ]
}

Response Example (400)

{
  "status": "error",
  "message": "Invalid query parameters."
}
\n

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 2402.

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 on Solana.

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.