Get Fear and Greed Index

Growth This endpoint requires the growth plan or higher. Free, Basic and Startup plans can use preview access.

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 all is available. Your plan’s historical window applies to both preview and production requests.

Default value: 24h
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.


timePeriod Available intervals (default in bold)
24h hour
7d hour, day
30d hour, day
3m hour, day, week
1y day, week, month
3y day, week, month
5y day, week, month
10y day, week, month
all day, week, month

Example:
https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d&interval=day

Code examples

curl
curl 'https://api.coinranking.com/v2/indicators/fear-and-greed?timePeriod=7d&interval=day' \
  -H 'x-access-token: your-api-key' \
  -G
JavaScript
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
<?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;
Python
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

json
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

json
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.