# HTTP

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-94c372f6de6358497860e76d44e0f038f1a1d801%2FHTTP_Options.png?alt=media" alt="" width="494"><figcaption></figcaption></figure>

### Options

Counter allows you to specify URL of an endpoint it's going to receive answer from, as well as specifying response lifetime (cache) in seconds.\
Data path is a path to get the desired value when the response's content type is [JSON](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/JSON), the syntax is similar to one used by JS to access properties and array items.

For more information on how to use this counter, refer to [more-on-complex-counters-1](https://docs.membercounter.app/readme/using-the-bot/more-on-complex-counters-1 "mention").

### Example usage

You can discover more APIs to use [here](https://github.com/public-apis/public-apis?tab=readme-ov-file#weather).

{% tabs %}
{% tab title="IQAir (Air Quality)" %}
Air quality endpoint using [IQAir](https://api-docs.iqair.com/?version=latest) (free, api key after signing up).

```url
https://api.airvisual.com/v2/city?city=Los%20Angeles&state=California&country=USA&key={{YOUR_API_KEY}}
```

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-b82449ec714563aeb79d1e96944ed68970ffd251%2FHTTP_ExampleIQAir.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Weather" %}
Weather endpoint using [Weatherapi.com](https://www.weatherapi.com/docs/) (free, api key after signing up).

```url
https://api.weatherapi.com/v1/current.json?key=<YOUR API KEY>&q=New%20York&aqi=no
```

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-ce987e630a7cb7231f79f8eb9a31d689ccc22e90%2FHTTP_ExampleWeather.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Bitcoin Exchange Rate (USD)" %}
BTC Info endpoint using [Coinlore API](https://www.coinlore.com/cryptocurrency-data-api).

```url
https://api.coinlore.net/api/ticker/?id=90
```

<figure><img src="https://1582170640-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Lu2S5r7lKtu4IK5ucu9%2Fuploads%2Fgit-blob-14b4b482f168bf3614ae4582c67ca4a63bd6f505%2FHTTPNumber_Example_BTC.png?alt=media" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}
