Skip to main content

How to get the list of topic IDs and their definition (queries)

List without their definition

You can use the resource endpoint API to retrieve just the IDs.

It will return an array of groups which contains an array of topics (or filters). The title is the group or topic’s name visible in the UI.

Command
curl -X GET 'https://api.talkwalker.com/api/v2/talkwalker/p/<project_id>/resources?type=search&access_token=<access_token>'

Result: topic_list_search_result.png

note

The group default is the ungrouped category.

Endpoint for the custom filters (type “filter”)

Command
curl -X GET 'https://api.talkwalker.com/api/v2/talkwalker/p/<project_id>/resources?type=filter&access_token=<access_token>'

Result: images/topic_list_filter_result.png

note

The group default_filter is the ungrouped category.

List all topics and custom filters with their definition

To retrieve all topics and custom filters structure in your project:

Command
curl -X GET 'https://api.talkwalker.com/api/v2/talkwalker/p/<project_id>/topics/list?access_token=<access_token>'

Result: topic_list_details_result.png

note

The fields included_queries and excluded_queries are an array of query lines.

Get the definition of a specific topic or custom filter

In order to only get the definition of a specific topic when calling the endpoint, we can add the topic ID to the endpoint.

Command
curl -X GET 'https://api.talkwalker.com/api/v2/talkwalker/p/<project_id>/topics/list/<topic_id>?access_token=<access_token>'

Result: topic_list_single_details_result.png

note

The fields included_queries and excluded_queries are an array of query lines.