> ## Documentation Index
> Fetch the complete documentation index at: https://docs.allium.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch latest token price

> Get the latest price for the given token addresses and chains.

export const SupportedChainsList = props => {
  const [data, setData] = useState(null);
  const [isLoading, setIsLoading] = useState(true);
  useEffect(() => {
    const fetchData = async () => {
      try {
        const response = await fetch("https://api.allium.so/api/v1/supported-chains/realtime-apis", {
          method: "GET"
        });
        if (!response.ok) {
          throw new Error(`HTTP error! status: ${response.status}`);
        }
        const responseData = await response.json();
        const filteredData = responseData.filter(entry => {
          const product = entry.endpoints[props.product_name];
          return product !== null;
        });
        setData(filteredData);
        setIsLoading(false);
      } catch (error) {
        setIsLoading(false);
      }
    };
    fetchData();
  }, []);
  if (isLoading) {
    return <div>Loading chain information...</div>;
  }
  if (!data) {
    return <div>No data available</div>;
  }
  const isCustomSQL = props.product_name === "custom_sql";
  return <div>
            {data.length > 0 && <table className="w-full">
                    <thead>
                        <tr>
                            <th>Chain</th>
                            <th>Chain ID</th>
                            <th>Status</th>
                            {isCustomSQL && <th>Tables</th>}
                        </tr>
                    </thead>
                    <tbody>
                        {data.map(chain => {
    const endpoint = chain.endpoints[props.product_name];
    return <tr key={chain.id}>
                                    <td style={{
      padding: '12px'
    }}>{chain.label}</td>
                                    <td style={{
      padding: '12px'
    }}><code>{chain.id}</code></td>
                                    <td style={{
      padding: '12px'
    }}>{endpoint ? endpoint.availability === "beta" ? "🌱 Beta" : "✅ Supported" : "❌ Not Supported"}</td>
                                    {isCustomSQL && <td style={{
      padding: '12px'
    }}>
                                            {endpoint && endpoint.tables ? endpoint.tables.map(t => t.name).join(", ") : "-"}
                                        </td>}
                                </tr>;
  })}
                    </tbody>
                </table>}
        </div>;
};

This endpoint returns the latest price and OHLC values for a list of tokens. Prices and OHLC values are aggregated from trades in the most recent completed minute interval. If no trades occurred in the last minute, the endpoint returns the most recent available data.

For inactive tokens, the last known price is derived from the most recent on-chain trade. If no trade has occurred within the past 7 days, the endpoint will return no data for that token. We recommend checking the timestamp included in the response, which corresponds to the last trade time.

## Pagination

This endpoint returns prices for up to 200 tokens in a single request.

## Supported Chains

<SupportedChainsList product_name="token_latest_price" />


## OpenAPI

````yaml /_openapi/prices-api.json POST /api/v1/developer/prices
openapi: 3.1.0
info:
  title: Allium API
  version: 0.1.0
servers:
  - url: https://api.allium.so
security: []
paths:
  /api/v1/developer/prices:
    post:
      tags:
        - PRICES
        - DEVELOPER
      summary: Latest Token Prices
      description: Get the latest prices for the given token addresses.
      operationId: get_latest_prices_api_v1_developer_prices_post
      parameters:
        - name: with_liquidity_info
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              If true, returns total_liquidity_usd as well. See [this
              page](https://docs.allium.so/api/developer/data-tips#token-liquidity-filtering)
              for more details.
            default: false
            title: With Liquidity Info
          description: >-
            If true, returns total_liquidity_usd as well. See [this
            page](https://docs.allium.so/api/developer/data-tips#token-liquidity-filtering)
            for more details.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/PayloadTokenAddress'
              minItems: 1
              maxItems: 200
              title: Payloads
            example:
              - token_address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
                chain: ethereum
              - token_address: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
                chain: solana
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Envelope_TokenPriceV2WithHiddenFields_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyBearer: []
components:
  schemas:
    PayloadTokenAddress:
      properties:
        token_address:
          type: string
          title: Token Address
          description: Token contract address
        chain:
          type: string
          title: Chain
          description: Lowercase chain name
      type: object
      required:
        - token_address
        - chain
      title: PayloadTokenAddress
      example:
        chain: ethereum
        token_address: '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
    Envelope_TokenPriceV2WithHiddenFields_:
      properties:
        items:
          items:
            $ref: '#/components/schemas/TokenPriceV2WithHiddenFields'
          type: array
          title: Items
          description: Response items
        cursor:
          anyOf:
            - type: string
            - type: 'null'
          title: Cursor
          description: Pagination cursor for next page
        message:
          anyOf:
            - type: string
            - type: 'null'
          title: Message
          description: Informational message (e.g. partial results)
      type: object
      required:
        - items
      title: Envelope[TokenPriceV2WithHiddenFields]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TokenPriceV2WithHiddenFields:
      properties:
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: ISO 8601 UTC candle time
        chain:
          type: string
          title: Chain
          description: Lowercase chain name
        address:
          type: string
          title: Address
          description: Token contract address
        decimals:
          anyOf:
            - type: integer
            - type: 'null'
          title: Decimals
          description: Token decimal places
        price:
          type: number
          title: Price
          description: Current price (USD) at the timestamp
        open:
          type: number
          title: Open
          description: Opening price (USD) at the start of the interval
        high:
          type: number
          title: High
          description: Highest price (USD) during the interval
        close:
          type: number
          title: Close
          description: Closing price (USD) at the end of the interval
        low:
          type: number
          title: Low
          description: Lowest price (USD) during the interval
      type: object
      required:
        - timestamp
        - chain
        - address
        - price
        - open
        - high
        - close
        - low
      title: TokenPriceV2WithHiddenFields
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyBearer:
      type: apiKey
      in: header
      name: X-API-KEY

````