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

# getSymbol

> Returns charting metadata for a given pair. Used for implementing a Trading View datafeed.

<div data-generated>
  ## GraphQL

  ```
  type Query {
    getSymbol(
      symbol: String!
      currencyCode: String
    ): SymbolResponse
  }

  type SymbolResponse {
    currency_code: String!
    description: String!
    name: String!
    original_currency_code: String!
    pricescale: Float!
    ticker: String!
    supported_resolutions: [String!]!
  }
  ```
</div>

### Example

<a href="/explore" target="_blank" rel="noopener noreferrer">Test this query in the Explorer →</a>

```graphql theme={null}
{
  getSymbol(
    symbol: "8WwcNqdZjCY5Pt7AkhupAFknV2txca9sq6YBkGzLbvdt:1399811149"
    currencyCode: "USD"
  ) {
    currency_code
    description
    name
    original_currency_code
    pricescale
    ticker
    supported_resolutions
  }
}
```

### Usage Guidelines

* Provide `symbol` as a pair ID in the format `pairAddress:networkId` (e.g., `0x88e6a0c2ddd26feeb64f039a2c41296fcb3f5640:1`)
* Set `currencyCode` to `USD` (default) for USD-denominated prices, or `TOKEN` for token-denominated prices
* Returns metadata required by TradingView's charting library to configure a symbol
* `pricescale` is `10^n` where n is the number of decimal places — use this for formatting prices on charts
* `supported_resolutions` lists the valid resolution values for use with `getBars` (e.g., `1`, `5`, `60`, `1D`)
* Use this query alongside `getBars` to implement a complete TradingView datafeed

### Troubleshooting Tips

<AccordionGroup>
  <Accordion title="How do I use this with TradingView?">
    `getSymbol` implements the `resolveSymbol` method in a TradingView UDF (Universal Data Feed). When TradingView requests symbol info, call this query with the pair ID and return the response fields. Use `getBars` to implement the `getBars` method for candlestick data.
  </Accordion>

  <Accordion title="What is pricescale used for?">
    `pricescale` tells TradingView how to format prices. A `pricescale` of `1000000` means the price has 6 decimal places. TradingView uses this to display prices correctly and snap to valid price increments. Max value is `10^16`.
  </Accordion>

  <Accordion title="When should I use TOKEN vs USD for currencyCode?">
    Use `USD` (default) when you want prices denominated in US dollars — this is the standard for most trading interfaces. Use `TOKEN` when you want prices in terms of the quote token (e.g., ETH or SOL), which is useful for showing native pair ratios.
  </Accordion>

  <Accordion title="What resolutions are supported?">
    `supported_resolutions` returns all valid timeframes: seconds (`1S`, `5S`, `15S`, `30S`), minutes (`1`, `5`, `15`, `30`, `60`), hours (`240`, `720`), and days (`1D`, `7D`). Pass these values to `getBars` when fetching candlestick data.
  </Accordion>
</AccordionGroup>
