Skip to navigation

Toutiao questions

The Toutiao action depends on the URL type. For an article URL (/article/<id>/), pass the ID as group_id to toutiao.app.get_article_info. For a video URL (/video/<id>/), pass the ID as group_id to toutiao.app.get_video_info. For an author profile URL, pass the full URL to toutiao.app.get_user_id. With the post ID, read the post’s comments with toutiao.app.get_comments.

Which action reads articles or videos?

For toutiao.com/article/123/, take the ID from the path (123 is an example) and pass the ID as group_id to toutiao.app.get_article_info. For toutiao.com/video/456/, pass the ID as group_id to toutiao.app.get_video_info. The web actions toutiao.web.get_article_info and toutiao.web.get_video_info both take the post ID as aweme_id. Keep the original ID as a string in every action.

How do I read comments on one article?

Send the body below to POST https://api.beatapi.io/v1/social-data/call with BeatAPI Bearer authentication:

{"action":"toutiao.app.get_comments","params":{"group_id":"123","offset":"0"}}
  1. Send the first batch with offset "0".
  2. For each next batch of the same article, add 20 to offset and send the new value as a string: "20", then "40".
  3. Save each batch in its own file.
  4. Stop on an empty or repeated batch, or when you reach your reading limit.

For example, to collect setup questions, keep each excerpt, the post link and the request ID, then group the comments you read.

toutiao.app.get_comments takes only the article ID and offset. If the editor needs the questions grouped by setup step, add a step label to the saved comments locally and keep the comments’ original order and source.

Pass the full profile URL as user_profile_url to toutiao.app.get_user_id. Confirm the author and the returned user_id, then send the user_id to toutiao.app.get_user_info. When two authors share a display name, tell the authors apart by their profile links.

Verify a Toutiao source and build a revision list from its comments · BeatAPI pricing