---
title: "History collection details"
method: GET
path: "/topics/{topicId}/history"
tags: ["History"]
---

# History collection details

`GET /topics/{topicId}/history`

## Request

- Base URL: `https://api.youscan.io/api/external`
- URL: `https://api.youscan.io/api/external/topics/{topicId}/history`
- 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/history/get.ts> (a function with typed inputs; its response is checked against the schema)

Get the status and progress of the historical data collection job for the topic.

## Path parameters

- `topicId` integer, required

## Response `200`

History collection job details.

- HistoryJobDetails
  - `topicId` integer: Topic ID.
  - `status` 'collecting' | 'failed' | 'failedComplexQuery' | 'completed' | 'aborted': Job status.
  - `started` string, date-time, nullable: Date and time when the job started.
  - `ended` string, date-time, nullable: Date and time when the job finished.
  - `from` string, date-time: Date from which data is collected.
  - `to` string, date-time: Date until which data is collected.
  - `query` string: Search query used for historical data collection.
  - `processedTo` string, date-time, nullable: Date until which data is already collected.
  - `progress` integer: Percentage completed.
  - `collected` integer: Number of mentions processed.
  - `saved` integer: Number of mentions saved to the topic.
  - `duplicates` integer: Number of duplicate mentions skipped.
  - `skipped` integer: Number of mentions skipped.
  - `invalid` integer: Number of invalid mentions.
  - `lastError` string, nullable: Last error message, if the job failed.

## Other responses

- `204`: No history collection job exists for the topic.
- `401`: The API key is missing or invalid.
- `403`: Your permission level for this topic is too low for the action.
- `404`: Topic not found or you don't have access to it.

---

[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)
