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

# getPrice

> Learn how to use the getPrice JSON-RPC method.

## Contextualizing `getPrice`

* `getPrice` returns an array of JSON objects containing real-time exchange rates, market cap, 24-hour changes, and volume for each specified token address in selected currencies (either `usd`, `cny`, or both at the moment).

***

## Query example

```javascript JavaScript theme={null}
const axios = require('axios');

(async () => {
    const response = await axios.post('https://rpc.particle.network/evm-chain', {
        chainId: 42,
        jsonrpc: '2.0',
        id: 1,
        method: 'particle_getPrice',
        params: [
            [
                'native', 
                '0x7968bc6a03017eA2de509AAA816F163Db0f35148',
            ],
            [
                'usd', 
                'cny',
            ],
        ],
    }, {
        auth: {
            username: 'Your Project Id',
            password: 'Your Project Server Key',
        },
    });

    console.log(response.data);
})();
```


## OpenAPI

````yaml openapi-evm POST /#particle_getPrice
openapi: 3.0.0
info:
  title: Particle Network Enhanced RPC
  version: 1.0.0
servers:
  - url: https://rpc.particle.network/evm-chain
security: []
paths:
  /#particle_getPrice:
    post:
      summary: getPrice
      operationId: getPrice
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetPriceRequest'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetPriceResponse'
      security:
        - basicAuth: []
components:
  schemas:
    GetPriceRequest:
      allOf:
        - $ref: '#/components/schemas/RPCRequest'
        - type: object
          properties:
            method:
              enum:
                - particle_getPrice
            params:
              type: array
              items:
                type: array
                items:
                  type: string
    GetPriceResponse:
      allOf:
        - $ref: '#/components/schemas/RPCResponse'
        - type: object
          properties:
            result:
              type: array
              description: Array of token price details.
              items:
                type: object
                properties:
                  address:
                    type: string
                    description: Token contract address.
                  currencies:
                    type: array
                    description: Array of currency details.
                    items:
                      type: object
                      properties:
                        type:
                          type: string
                          description: Currency type.
                        price:
                          type: number
                          description: Price of the token.
                        marketCap:
                          type: number
                          description: Market capitalization.
                        24hChange:
                          type: number
                          description: 24-hour price change.
                        24hVol:
                          type: number
                          description: 24-hour trading volume.
                        lastUpdatedAt:
                          type: integer
                          description: Timestamp of the last update.
    RPCRequest:
      type: object
      required:
        - jsonrpc
        - id
        - method
        - params
        - chainId
      properties:
        jsonrpc:
          type: string
          default: 2
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          default: 1
          description: The request identifier.
          example: 1
        method:
          type: string
          description: API method being called.
        chainId:
          type: integer
          example: 1
          description: The chain ID.
        params:
          type: array
          description: Parameters for the API method call.
    RPCResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          description: Version of the JSON-RPC protocol, should be 2.0.
          example: '2.0'
        id:
          type: integer
          description: The request identifier.
          example: 1
        result:
          anyOf:
            - $ref: '#/components/schemas/AnyValue'
    AnyValue:
      anyOf:
        - type: string
        - type: number
        - type: integer
        - type: boolean
        - type: object
        - type: array
          items: {}
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic

````