Get Fear and Greed Index
Get the Fear and Greed Index for the cryptocurrency market throughout time. The Fear and Greed Index is a market-wide sentiment indicator that measures the current mood of the crypto market on a scale from 0 (extreme fear) to 100 (extreme greed). It is calculated based on factors such as volatility, market momentum, social media sentiment, and more. On Coinranking, we use this endpoint on our AI Fear & Greed chart.
https://api.coinranking.com/v2/indicators/fear-and-greed
Preview access
Free, Basic and Startup plans can test this endpoint with five successful requests per account per UTC day. Use the documented endpoint URL with your existing API key. Preview access is applied automatically. The allowance resets at 00:00 UTC.
Query parameters
| Parameter | Description | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
timePeriod (optional) String | The time period for which the Fear and Greed Index data is returned. The number of data points and the default interval are determined by the time period. Every time period up to Allowed values: 24h 7d 30d 3m 1y 3y 5y 10y all Example:
https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d
| ||||||||||||||||||||
interval (optional) String | The interval determines the granularity of each data point. If not provided, a default interval is used based on the selected timePeriod. Only certain intervals are available per timePeriod — see the table below.
Example:
https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d&interval=day
|
Code examples
curl 'https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d&interval=day' \
-H 'x-access-token: your-api-key' \
-G const options = {
headers: {
'x-access-token': 'your-api-key',
},
};
fetch('https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d&interval=day', options)
.then((response) => response.json())
.then((result) => console.log(result)); <?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d&interval=day",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => array(
"x-access-token: your-api-key"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response; import requests
headers = {
'x-access-token': 'your-api-key'
}
response = requests.request("GET", "https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d&interval=day", headers=headers)
print(response.text) Response
HTTP/1.1 200 OK
{
"status": "success",
"data": [
{
"timestamp": 1774948648,
"value": 39.2714
},
{
"timestamp": 1774944000,
"value": 38.1845
}
]
} Response fields
| Property | Description |
|---|---|
status String | Status of the request Allowed values:success |
data Object[] | List of Fear and Greed Index data points |
data.timestamp Number | An Epoch timestamp in seconds. |
data.value Number/null | The Fear and Greed Index value on a scale from 0 to 100. A value of 0 represents extreme fear, while 100 represents extreme greed. Returns null if no data is available for this time period. |
Error response
HTTP/1.1 422 Unprocessable Entity
{
"status": "fail",
"type": "VALIDATION_ERROR",
"message": "timePeriod must be one of 24h, 7d, 30d, 3m, 1y, 3y, 5y, 10y, all"
} Error responses
| Error | Description |
|---|---|
VALIDATION_ERROR Object | The request could not be validated. The response should provide more details. |