Skip to main content

Usage

Request Header

Add the API key to your request as a header with key X-API-KEY when calling the API to authorize your requests.

import requests
from pprint import pprint

response = requests.get(
url="https://api.clearmacro.com/api/v3/signal/",
headers={"X-API-KEY": "YOUR_SECRET_API_KEY"}
)
pprint(response.json())
curl -X "GET" \
https://api.clearmacro.com/api/v3/signal/ \
-H "X-API-KEY:YOUR_SECRET_API_KEY"

URL Parameter

Another option to sending the API Key is to send it in the URL request, appending it as the parameter api_key.

This authentication method facilitates clients, e.g. Excel Web Query, who cannot customise request headers.

danger

In general, applications that use URLs do not treat them as sensitive information. They are rendered in plain text and can be easily copied and pasted in most cases.

Only use this API_KEY authentication method if you have no alternative.

If you use the API Key as a URL parameter, avoid sharing the URL with others to ensure they do not access data under your account.

import requests
from pprint import pprint

response = requests.get(
url=f"https://api.clearmacro.com/api/v3/signal/?api_key={YOUR_SECRET_API_KEY}",
)
pprint(response.json())
curl -X "GET" \
"https://api.clearmacro.com/api/v3/signal/?api_key=YOUR_SECRET_API_KEY"