Skip to main content

Streams

Receiving results from a stream works in two steps: First, the stream is created, then the data is accessed.

A stream is a collection of rules, where at least one must be provided for it to provide results. It is therefore recommended for the stream creation request to contain at least 1 rule in its body.

Stream creation command
curl -XPUT 'https://api.talkwalker.com/api/v3/stream/s/<stream_id>?access_token=<access_token>'
-d '{"rules" : [{"rule_id" : "<rule_id>", "query":"<query>"}]}'
-H "Content-Type: application/json; charset=UTF-8"

For the set of optional parameters for data access of a stream, consult this table.

GET request command
curl -XGET 'https://api.talkwalker.com/api/v3/stream/s/<stream_id>/results?access_token=<access_token>&q=<query>'
POST request command
curl -XPOST 'https://api.talkwalker.com/api/v3/stream/s/<stream_id>/results?access_token=<access_token>'
-d '<query_data>'
-H 'Content-Type: application/json; charset=UTF-8'
Optional parameters
parameterdescription
qthe query to search for
max_hitsstops the stream after the given number of hits

Each result consumes 1 credit, regardless of the number of matched rules. When the parameter max_hits is set, only the specified maximum number of results will be billed, even if the entire timeframe gets streamed after reaching the limit.

Rate Limit

This endpoint is limited to 5 calls per minute.