# Reddit APIs

{% hint style="info" %}
Uptick's Reddit feed is collected from crypto-specific sub-Reddits. Aggregated, parsed, cleaned, and enriched per currency for a unified data stream. Our proprietary algorithms derive sentiment for post and calculate the sentiment index on a bullish and bearish scale.
{% endhint %}

## <mark style="color:blue;">1. Reddit Feed API</mark>

## Gets detailed Reddit posts, aggregate news sentiment, and sentiment by post for currencies

<mark style="color:blue;">`GET`</mark> `https://api.uptick.co/api/reddit`

#### Query Parameters

| Name                                       | Type    | Description                                                                                                                                          |
| ------------------------------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
| currency<mark style="color:red;">\*</mark> | STRING  | The coin (or comma-separated list of coins) for which to fetch news articles                                                                         |
| interval<mark style="color:red;">\*</mark> | INTEGER | The number of milliseconds to look back and average sentiment- defaults to 7776000000 (which is 90 days). Pass -1 to avoid time filtering completely |
| limit                                      | INTEGER | The number of records to find and return                                                                                                             |
| text                                       | STRING  | A substring that must be present in returned articles                                                                                                |
| min\_mention\_count                        | INTEGER | The minimum number of times a coin must be mentioned in an article                                                                                   |
| primary\_coin                              | BOOLEAN | If this flag is set, returns results only if the desired coin is mentioned more frequently than other coins in the text                              |
| source                                     | STRING  | The source of the news article (Coindesk for example)                                                                                                |
| relevance                                  | FLOAT   | The minimum relevance-model score for results; the relevance model assigns a 0-1 value based on how focused on crypto an article is. Defaults to 0.6 |
| sort\_by                                   | STRING  | Field to use in sorting- defaults to sorting by time. coin\_relevance is currently the only other option                                             |
| fields                                     | STRING  | A comma separated list of the fields to return in the results. Can be set to \* to see all fields                                                    |

#### Headers

| Name                                       | Type   | Description                 |
| ------------------------------------------ | ------ | --------------------------- |
| api\_key<mark style="color:red;">\*</mark> | STRING | API key of customer account |

{% tabs %}
{% tab title="200: OK success" %}

```json
[
  {
    "author": "glowingmushrooms",
    "collected_at": "2022-06-09T10:12:10.171Z",
    "selftext": "!!!Best hidden gem!!! up 900% in a day despite bear market, can this coin be the next bitcoin ? \\*alarms rockets and orgasm face on thumbnail\\*",
    "subreddit": "CryptoCurrency",
    "url": "www.reddit.com//r/CryptoCurrency/comments/v8carb/made_a_dumb_crypto_for_fun_several_wallets_have/ibpmzn1/",
    "MESentimentModel": 0.8751850161776852
  },
  {
    "author": "Mugen4u32",
    "collected_at": "2022-06-09T10:11:22.367Z",
    "selftext": "\\*they do it to so it's alright\\*\n\nwhat is this bullshit. Bitcoin should be forbidden as long as it consumes so much energy.",
    "subreddit": "CryptoCurrency",
    "url": "www.reddit.com//r/CryptoCurrency/comments/v8478d/im_sick_of_hearing_climate_change_and_bitcoin_in/ibpmxys/",
    "MESentimentModel": 0.6422199194016467
  },
  {
    "author": "Intelligent_Page2732",
    "collected_at": "2022-06-09T10:11:14.778Z",
    "selftext": "I wonder how long Bitcoin will stay around 30K..",
    "subreddit": "CryptoCurrency",
    "url": "www.reddit.com//r/CryptoCurrency/comments/v83lxc/daily_general_discussion_june_9_2022_gmt0/ibpm42q/",
    "MESentimentModel": 0.5515009669297632
  }
]
```

{% endtab %}
{% endtabs %}

## <mark style="color:blue;">2. Reddit Sentiment API</mark>

## Retrieve average Reddit sentiment for a currency

<mark style="color:blue;">`GET`</mark> `https://api.uptick.co/api/reddit-sentiment`

#### Query Parameters

| Name                                       | Type    | Description                                                                                                          |
| ------------------------------------------ | ------- | -------------------------------------------------------------------------------------------------------------------- |
| currency<mark style="color:red;">\*</mark> | STRING  | The currency (or comma-separated list of currencies) for which to fetch average sentiment- expects a symbol like BTC |
| interval<mark style="color:red;">\*</mark> | INTEGER | The number of milliseconds to look back and average sentiment- defaults to 604800000 (which is one week)             |

#### Headers

| Name     | Type   | Description                 |
| -------- | ------ | --------------------------- |
| api\_key | STRING | API key of customer account |

{% tabs %}
{% tab title="200: OK " %}

```json
[
{ "_id": { "currency": "BTC" }, "avgSentiment": 0.6027129670844735 },
{ "_id": { "currency": "ETH" }, "avgSentiment": 0.6833787754969072 }
 ]
```

{% endtab %}
{% endtabs %}

## <mark style="color:blue;">3. Reddit Post Count Timeseries API</mark>

## Retrieve historical count of Reddit posts for a currency &#x20;

<mark style="color:blue;">`GET`</mark> `https://api.uptick.co/api/rcount-series`

#### Query Parameters

| Name                                       | Type   | Description                                                             |
| ------------------------------------------ | ------ | ----------------------------------------------------------------------- |
| currency<mark style="color:red;">\*</mark> | STRING | The currency for which to fetch count values- expects a symbol like BTC |

#### Headers

| Name                                       | Type   | Description                 |
| ------------------------------------------ | ------ | --------------------------- |
| API\_KEY<mark style="color:red;">\*</mark> | STRING | API key of customer account |

{% tabs %}
{% tab title="200: OK Sample Response" %}
{% code overflow="wrap" lineNumbers="true" fullWidth="true" %}

```json
[
  {
    "_id": "629eaeaa792616016c6878b8",
    "currency": "BTC",
    "date": "2022-06-07T00:00:00.000Z",
    "count": 130
  },
  {
    "_id": "629d5c08792616400616e833",
    "currency": "BTC",
    "date": "2022-06-06T00:00:00.000Z",
    "count": 108
  },
  {
    "_id": "629c0b347926165e50516033",
    "currency": "BTC",
    "date": "2022-06-05T00:00:00.000Z",
    "count": 360
  }
]
```

{% endcode %}
{% endtab %}
{% endtabs %}

## <mark style="color:blue;">4. Reddit Sentiment Timeseries API</mark>

## Retrieve historical sentiment of Reddit posts for a currency &#x20;

<mark style="color:blue;">`GET`</mark> `https://api.uptick.co/api/rsen-series`

#### Query Parameters

| Name     | Type   | Description                                                                 |
| -------- | ------ | --------------------------------------------------------------------------- |
| currency | STRING | The currency for which to fetch sentiment values- expects a symbol like BTC |

#### Headers

| Name     | Type   | Description                 |
| -------- | ------ | --------------------------- |
| API\_KEY | STRING | API key of customer account |

{% tabs %}
{% tab title="200: OK " %}

```json
[
  {
    "_id": "629eaeaa792616016c6878c7",
    "currency": "BTC",
    "date": "2022-06-07T00:00:00.000Z",
    "sentiment": 0.6055613484891158
  },
  {
    "_id": "629d5c08792616400616e841",
    "currency": "BTC",
    "date": "2022-06-06T00:00:00.000Z",
    "sentiment": 0.6011647159980866
  },
  {
    "_id": "629c0b357926165e50516041",
    "currency": "BTC",
    "date": "2022-06-05T00:00:00.000Z",
    "sentiment": 0.6404868679951908
  }
]
```

{% endtab %}
{% endtabs %}
