Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.codex.io/llms.txt

Use this file to discover all available pages before exploring further.

This endpoint requires a Growth or Enterprise plan. Learn more.

Returns

ChartUrlsResponse
ChartUrlsResponse
See ChartUrlsResponse

Arguments

input
ChartInput!
required
Input required to fetch a pair chart. See ChartInput

Example

Test this query in the Explorer →
{
  chartUrls(
    input: {
      pair: {
        chartSettings: {
          pairAddress: "8WwcNqdZjCY5Pt7AkhupAFknV2txca9sq6YBkGzLbvdt"
          networkId: 1399811149
          resolution: "60"
          quoteToken: token1
          theme: DARK
        }
        imageOptions: {
          width: 800
          height: 450
          expirationSeconds: 300
        }
      }
    }
  ) {
    pair {
      url
    }
  }
}

Usage Guidelines

  • Provide pairAddress and networkId to generate a chart URL for a specific trading pair
  • resolution sets the candlestick timeframe — valid values include "1S", "5S", "15S", "30S", "1", "5", "15", "30", "60", "240", "720", "1D", "7D"
  • quoteToken determines which token is the quote currency — use token0 or token1
  • theme can be LIGHT or DARK to match your application’s design
  • Use from and to (Unix timestamps) to specify a custom time range for the chart
  • imageOptions lets you customize dimensions (width, height) and URL lifetime (expirationSeconds)
  • The returned URL is a pre-signed URL that expires after the specified duration (default varies by plan)

Troubleshooting Tips

Resolution values include seconds ("1S", "5S", "15S", "30S"), minutes ("1", "5", "15", "30", "60"), hours ("240", "720"), and days ("1D", "7D"). For example, "60" gives hourly candles, "240" gives 4-hour candles.
The URL expiration depends on expirationSeconds in imageOptions. If not specified, the default expiration is set by your plan tier. URLs are pre-signed and will return an error after expiration — generate a new URL when needed.
quoteToken determines which token’s price is shown. If you want the chart to show “Token A in terms of Token B”, set quoteToken to the token B position. Check pairMetadata to see which token is token0 vs token1 if you’re unsure.
The chartUrls query requires a Growth or Enterprise plan. If you’re on the Free or Standard plan, you’ll receive an authorization error. Upgrade your plan at codex.io to access chart image generation.