# Get Tickers

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

GET https://bitcoin-mainnet.g.alchemy.com/v2/{apiKey}/api/v2/tickers/

Returns the currency rate for the specified currency and timestamp. If the requested currency is unavailable for that timestamp, the closest rate is returned with the actual rate timestamp.

> **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this > time` on the Alchemy proxy. The schema and request shape below are documented for > reference; "Try It" will not return live data until the upstream service is restored.


Reference: https://www.alchemy.com/docs/chains/bitcoin/utxo-api-endpoints/utxo-api-endpoints/get-tickers

## Path Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| apiKey | string | Yes | For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup) |

## Query Parameters

| Name | Type | Required | Description |
|------|------|----------|-------------|
| currency | string | No | Fiat or crypto currency code (e.g. `usd`, `eur`, `eth`). Omit to return all. |
| timestamp | integer | No | Unix timestamp. Omit to return the latest. |
| block | string | No | Block height or hash whose timestamp should be used for historical rates. |
| token | string | No | Token symbol or contract/address key for token-specific rates. |

## Code Examples

### cURL

```bash
curl --request GET \
  --url https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo/api/v2/tickers/
```

### JavaScript

```javascript
const options = {method: 'GET'};

fetch('https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo/api/v2/tickers/', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo/api/v2/tickers/"

response = requests.get(url)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo/api/v2/tickers/"

	req, _ := http.NewRequest("GET", url, nil)

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.get("https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo/api/v2/tickers/")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://bitcoin-mainnet.g.alchemy.com/v2/docs-demo/api/v2/tickers/");
var client = new RestClient(options);
var request = new RestRequest("");
var response = await client.GetAsync(request);

Console.WriteLine("{0}", response.Content);

```


## Operation Specification

```yaml
path: /{apiKey}/api/v2/tickers/
method: GET
operation:
  operationId: getTickers
  summary: Get Tickers
  description: |
    Returns the currency rate for the specified currency and timestamp. If the requested currency is unavailable for that timestamp, the closest rate is returned with the actual rate timestamp.

    > **Heads up**: this endpoint currently returns HTTP 503 `Unable to complete request at this > time` on the Alchemy proxy. The schema and request shape below are documented for > reference; "Try It" will not return live data until the upstream service is restored.
  tags:
    - UTXO API Endpoints
  parameters:
    - name: apiKey
      in: path
      required: true
      schema:
        type: string
        default: docs-demo
      description: For higher throughput, [create your own API key](https://dashboard.alchemy.com/signup)
    - in: query
      name: currency
      required: false
      description: Fiat or crypto currency code (e.g. `usd`, `eur`, `eth`). Omit to return all.
      schema:
        type: string
        example: usd
    - in: query
      name: timestamp
      required: false
      description: Unix timestamp. Omit to return the latest.
      schema:
        type: integer
        example: 1574346615
    - in: query
      name: block
      required: false
      description: Block height or hash whose timestamp should be used for historical rates.
      schema:
        type: string
    - in: query
      name: token
      required: false
      description: Token symbol or contract/address key for token-specific rates.
      schema:
        type: string
  responses:
    '200':
      description: Currency rate response.
      content:
        application/json:
          schema:
            type: object
            properties:
              ts:
                type: integer
              rates:
                type: object
                additionalProperties:
                  type: number
          example:
            ts: 1574346615
            rates:
              usd: 7914.5
    '400':
      description: Malformed request.
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: string
                description: Human-readable error message.
          example:
            error: invalid request
```
