# omnia\_getTokenPrice

**Return the price of an ERC-20 token.**

{% hint style="info" %}
**Please make sure that the token address for which the price is requested is corresponding to an ERC-20 token and the token is available on the network (endpoint) the request is sent to.**
{% endhint %}

**Parameters**

1. `DATA`, 20 Bytes - **tokenAddress**. ERC-20 token address for which the price is requested.  <mark style="color:red;">REQUIRED</mark>
2. `DATA`, positive number - **pricingDecimals**. Number of decimals used for the returned price. Default value: 5. **OPTIONAL**

**Returns**

1. tokenAddress: address of the ERC-20 token
2. tokenSymbol: ERC-20 symbol as stored in the token smart contract
3. tokenDecimals: ERC-20 decimals as stored in the token smart contract
4. usdPrice: Positive number representing token price denominated in U.S. dollars. (0 if the price of the token cannot be determined)

## Example

```json
{
    "id": 1,
    "jsonrpc": "2.0",
    "method": "omnia_getTokenPrice",
    "params": [{
        "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "pricingDecimals": 5

    }]
}
```

#### Response

```json
{
    "id": 1,
    "jsonrpc": "2.0",
    "result": {
        "tokenAddress": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
        "tokenSymbol": "WETH",
        "tokenDecimals": 18,
        "usdPrice": 2022.86554
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.omniatech.io/rpc-api-docs/chains/fantom/custom-json-rpc-api/omnia_gettokenprice.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
