# News APIs

{% hint style="info" %}
Uptick's news feed is collected from over 30K news sources. Aggregated, parsed, cleaned, and enriched per currency for a unified data stream. Our proprietary algorithms derive sentiment for articles and calculate the sentiment index on a bullish and bearish scale.
{% endhint %}

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

## Gets detailed news articles, aggregate news sentiment, and sentiment by article for currencies

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

#### 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
[
  {
    "source": {
      "id": {},
      "name": "Cointelegraph"
    },
    "_id": "629ee39379261658f177f821",
    "url": "https://cointelegraph.com/news/longer-term-bitcoin-holder-losses-hit-two-year-lows",
    "RelevanceModel": 0.9999999999911264,
    "author": "Cointelegraph By Brian Newar",
    "collected_at": "2022-06-07T05:35:16.128Z",
    "description": "Bitcoin’s long-term holders are beginning to suffer losses matching those from previous bear markets, and Glassnode believes the pain may continue, and even get worse.",
    "title": "Longer-term Bitcoin holder losses hit two year lows",
    "MESentimentModel": 0.16335045675452212
  },
  {
    "source": {
      "id": {},
      "name": "Cointelegraph"
    },
    "_id": "629ec78f7926165e0d595f01",
    "url": "https://cointelegraph.com/news/two-more-spot-crypto-etfs-launch-on-australian-markets",
    "RelevanceModel": 0.9999999999999998,
    "author": "Cointelegraph By Jesse Coghlan",
    "collected_at": "2022-06-07T03:35:44.086Z",
    "description": "Two cryptocurrency exchange-traded funds tracking the price of Bitcoin (BTC) and Ethereum (ETH) launched in Australia on the Cboe Exchange joining the existing funds by 21Shares and Cosmos Asset Management.",
    "title": "Two more spot crypto ETFs launch on Australian markets",
    "MESentimentModel": 0.564157890660442
  },
  {
    "source": {
      "id": {},
      "name": "Cointelegraph"
    },
    "_id": "629eb8b07926167611130b24",
    "url": "https://cointelegraph.com/news/indonesia-licensed-crypto-asset-platform-pintu-raises-113m-in-series-b",
    "RelevanceModel": 0.9999999999999998,
    "author": "Cointelegraph By Arijit Sarkar",
    "collected_at": "2022-06-07T02:35:44.543Z",
    "description": "The latest $113 million fund injection will be redirected to scale the platform’s existing offerings, such as introducing new features and added support for blockchains.",
    "title": "Indonesia-licensed crypto asset platform Pintu raises $113M in Series B",
    "MESentimentModel": 0.9045813009358251
  }
]
```

{% endtab %}
{% endtabs %}

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

## Retrieve average news sentiment for a currency

<mark style="color:blue;">`GET`</mark> `https://api.uptick.co/api/news-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. News Article Count Timeseries API</mark>

## Retrieve historical count of news articles for a currency &#x20;

<mark style="color:blue;">`GET`</mark> `https://api.uptick.co/api/ncount-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. News Sentiment Timeseries API</mark>

## Retrieve historical sentiment of news articles for a currency &#x20;

<mark style="color:blue;">`GET`</mark> `https://api.uptick.co/api/nsen-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 %}
