---
title: "Links"
method: GET
path: "/topics/{topicId}/statistics/links"
tags: ["Statistics"]
---

# Links

`GET /topics/{topicId}/statistics/links`

## Request

- Base URL: `https://api.youscan.io/api/external`
- URL: `https://api.youscan.io/api/external/topics/{topicId}/statistics/links`
- Auth: one of:
  - API key in header `X-API-KEY`
  - API key in query parameter `apiKey`
- TypeScript: <https://skmtc.dev/youscan/apis/youscan-api/docs/topics/:topicId/statistics/links/get.ts> (a function with typed inputs; its response is checked against the schema)

Get statistics for top links and hosts (domains).

## Path parameters

- `topicId` integer, required

## Query parameters

- `from` string, date
- `to` string, date
- `size` integer
- `sort` 'count' | 'totalEngagement' | 'avgEngagement'
- `country` string[]
- `excludeCountry` string[]
- `sourceTypes` SourceTypeFilter[]
- `excludeSourceTypes` SourceTypeFilter[]
- `sources` string[]
- `excludeSources` string[]
- `tags` integer[]
- `excludeTag` integer[]
- `subcategories` integer[]
- `excludeSubcategory` integer[]

## Response `200`

Top links and hosts.

- object
  - `links` LinkItem[]
    - `key` string: The link, or the root domain for hosts.
    - `count` integer: Number of mentions containing the link.
    - `totalEngagement` integer
    - `avgEngagement` number: Average engagement per mention. Omitted when the link has no engagement.
    - `sentiment` object: Distribution by sentiment.
      - `values` object[]
        - `key` 'positive' | 'neutral' | 'negative' | 'undefined'
        - `count` integer
      - `otherCount` integer
  - `hosts` LinkItem[]
    - `key` string: The link, or the root domain for hosts.
    - `count` integer: Number of mentions containing the link.
    - `totalEngagement` integer
    - `avgEngagement` number: Average engagement per mention. Omitted when the link has no engagement.
    - `sentiment` object: Distribution by sentiment.
      - `values` object[]
        - `key` 'positive' | 'neutral' | 'negative' | 'undefined'
        - `count` integer
      - `otherCount` integer
  - `totalCount` integer

## Other responses

- `401`: The API key is missing or invalid.

---

[API](https://skmtc.dev/youscan/apis/youscan-api.md) - [All operations](https://skmtc.dev/youscan/apis/youscan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/youscan/apis/youscan-api/revisions/f5bef260f153?raw)
