> For the complete documentation index, see [llms.txt](https://iskillbots-organization.gitbook.io/api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://iskillbots-organization.gitbook.io/api/tiker-kursov-btc-ltc.md).

# Тикер курсов btc/ltc

API эндпоинт по GET-запросу по адресу <https://iskillbot.ru/api/ticker/btc> предоставляет возможность получить текущее значение тикера курса криптовалюты Bitcoin (BTC) относительно любой другой валюты.

В ответ на запрос, сервер возвращает объект JSON, содержащий курс валюты BTC по отношению к указанной валюте. Пример ответа: {"usd": 27392.2819}.

Значение ключа в ответе отображает код валюты, относительно которой был получен курс BTC. Значение курса отображается в соответствующем значении ключа в формате числа с плавающей точкой.

Обращаем внимание, что API эндпоинт поддерживает только GET-запросы.

Вот пример кода на языке PHP, который использует функцию `file_get_contents()` для отправки GET-запроса к API эндпоинту и получения курса BTC относительно USD:

```php
<?php
$url = "https://iskillbot.ru/api/ticker/btc"; // или /api/ticker/ltc
$response = file_get_contents($url);

if ($response !== false) {
    $ticker_data = json_decode($response, true);
    $usd_price = $ticker_data["usd"];
    echo "The current BTC/USD price is $usd_price";
} else {
    echo "Error occurred with the request";
}
?>
```

В этом примере мы отправляем GET-запрос к API эндпоинту и сохраняем ответ в переменной `$response`. Затем мы проверяем, что ответ не равен `false` (что означает ошибку при выполнении запроса), и, если все в порядке, мы декодируем JSON-ответ с помощью функции `json_decode()` и извлекаем значение курса BTC относительно USD из массива данных тикера. Затем мы выводим значение на экран. Если запрос вернул ошибку, мы выводим соответствующее сообщение.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://iskillbots-organization.gitbook.io/api/tiker-kursov-btc-ltc.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
