Toutiao Article Details API (V1)
API health status
Healthy Available Limited Mostly unavailable No data
Loading health status...
Retrieves details for a Toutiao article identified by its article ID. Use it to look up a known article for content review, archiving, or related media analysis.
Parameters
| Name | In | Type | Required | Default | Description |
|---|---|---|---|---|---|
token | query | string | Yes | - | Authentication token required to access the API. |
id | query | string | Yes | - | The unique identifier of the Toutiao article. |
Code Samples
bash
curl --max-time 120 -X GET 'https://api.justoneapi.com/api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE'text
I want to use the "Article Details (V1)" API from JustOneAPI.
Base URL: https://api.justoneapi.com.
API Path: /api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE
API Endpoint: BASE_URL + /api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE
HTTP Method: GET
Authentication: Append the "token" query parameter to the URL.
OpenAPI Definition: https://docs.justoneapi.com/openapi/toutiao/article-details-v1-en.json
Parameters:
- token (query): Authentication token required to access the API. (Required)
- id (query): The unique identifier of the Toutiao article. (Required)
Return format: safely handle JSON or text according to the actual Content-Type.
Response Handling & Error Codes:
1. Business results should be determined by the "code" field in the response body (code 0 means success).
2. Timeout Recommendation: Set the request timeout to 120 seconds. If 120 seconds is too long for your use case, use at least 60 seconds, but a small number of requests may time out before receiving a result.
3. Business Code Reference:
- 0: Success
- 100: Invalid or Inactive Token
- 301: Collection Failed. Please Retry.
- 302: Rate Limit Exceeded
- 303: Daily Quota Exceeded
- 400: Invalid Parameters
- 500: Internal Server Error
- 600: Permission Denied
- 601: Insufficient Balance
- 602: Token Budget Exceeded
4. Code 601 means the shared account balance is insufficient. Code 602 means the current API token's own cumulative budget limit has been reached. Token budget limits do not transfer funds out of the shared account balance.
Please help me write a script in my preferred programming language to call this API and handle the response.python
import requests
BASE_URL = "https://api.justoneapi.com" # Provided by OpenAPI servers
url = BASE_URL + "/api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE"
response = requests.get(url, timeout=120)
print(response.status_code)
if response.content:
content_type = response.headers.get("content-type", "").lower()
if "json" in content_type:
try:
print(response.json())
except ValueError:
print(response.text)
elif content_type.startswith("text/") or "xml" in content_type or content_type.split(";", 1)[0].strip() in {"application/javascript", "application/x-www-form-urlencoded", "application/graphql"}:
print(response.text)
else:
with open("response.bin", "wb") as output:
output.write(response.content)
print(f"Saved {len(response.content)} bytes to response.bin")js
const BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
const url = BASE_URL + "/api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE";
const response = await fetch(url, {
method: "GET",
signal: AbortSignal.timeout(120000)
});
console.log(response.status);
const responseBytes = await response.arrayBuffer();
if (responseBytes.byteLength) {
const contentType = (response.headers.get("content-type") || "").toLowerCase();
const mediaType = contentType.split(";", 1)[0].trim();
const textual = contentType.startsWith("text/") || contentType.includes("json") || contentType.includes("xml") || ["application/javascript", "application/x-www-form-urlencoded", "application/graphql"].includes(mediaType);
if (textual) {
const responseText = new TextDecoder().decode(responseBytes);
let data = responseText;
if (contentType.includes("json")) {
try { data = JSON.parse(responseText); } catch { /* Keep the raw body. */ }
}
console.log(data);
} else {
console.log(`Received ${responseBytes.byteLength} binary bytes`);
}
}java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.time.Duration;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.Path;
public class Main {
public static void main(String[] args) throws Exception {
final String BASE_URL = "https://api.justoneapi.com"; // Provided by OpenAPI servers
final String url = BASE_URL + "/api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE";
HttpClient client = HttpClient.newBuilder().connectTimeout(Duration.ofSeconds(120)).build();
HttpRequest.Builder builder = HttpRequest.newBuilder()
.uri(URI.create(url))
.timeout(Duration.ofSeconds(120))
.method("GET", HttpRequest.BodyPublishers.noBody());
HttpRequest request = builder.build();
HttpResponse<byte[]> response = client.send(request, HttpResponse.BodyHandlers.ofByteArray());
System.out.println(response.statusCode());
String contentType = response.headers().firstValue("content-type").orElse("").toLowerCase();
String mediaType = contentType.split(";", 2)[0].trim();
if (contentType.startsWith("text/") || contentType.contains("json") || contentType.contains("xml") || mediaType.equals("application/javascript") || mediaType.equals("application/x-www-form-urlencoded") || mediaType.equals("application/graphql")) {
System.out.println(new String(response.body(), StandardCharsets.UTF_8));
} else {
Files.write(Path.of("response.bin"), response.body());
System.out.println("Saved " + response.body().length + " bytes to response.bin");
}
}
}go
package main
import (
"fmt"
"io"
"os"
"strings"
"net/http"
"time"
)
const BASE_URL = "https://api.justoneapi.com" // Provided by OpenAPI servers
func main() {
client := &http.Client{Timeout: 120 * time.Second}
url := BASE_URL + "/api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE"
req, _ := http.NewRequest("GET", url, nil)
resp, _ := client.Do(req)
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
bodyBytes, _ := io.ReadAll(resp.Body)
contentType := strings.ToLower(resp.Header.Get("Content-Type"))
mediaType := strings.TrimSpace(strings.SplitN(contentType, ";", 2)[0])
if strings.HasPrefix(contentType, "text/") || strings.Contains(contentType, "json") || strings.Contains(contentType, "xml") || mediaType == "application/javascript" || mediaType == "application/x-www-form-urlencoded" || mediaType == "application/graphql" {
fmt.Println(string(bodyBytes))
} else {
os.WriteFile("response.bin", bodyBytes, 0600)
fmt.Printf("Saved %d bytes to response.bin\n", len(bodyBytes))
}
}php
<?php
$BASE_URL = 'https://api.justoneapi.com'; // Provided by OpenAPI servers
$url = $BASE_URL . '/api/toutiao/get-article-detail/v1?token=YOUR_API_KEY&id=VALUE';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
$response = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
$contentType = strtolower((string) curl_getinfo($ch, CURLINFO_CONTENT_TYPE));
curl_close($ch);
echo $status . PHP_EOL;
$mediaType = trim(explode(';', $contentType, 2)[0]);
if (str_starts_with($contentType, 'text/') || str_contains($contentType, 'json') || str_contains($contentType, 'xml') || in_array($mediaType, ['application/javascript', 'application/x-www-form-urlencoded', 'application/graphql'], true)) {
echo $response;
} else {
file_put_contents('response.bin', $response);
echo 'Saved ' . strlen($response) . ' bytes to response.bin' . PHP_EOL;
}Response Fields
Key fields in a successful response (code = 0).
Article and publication21 fields
data.data
Article body, publishing metadata, and media variants.
| Field | Type | Description |
|---|---|---|
content | string | Article body returned as HTML text. |
group_id | integer | Native numeric article group ID. Use h5_extra.str_group_id to preserve exact digits in JavaScript. |
item_id | integer | Native numeric article item ID. Use h5_extra.str_item_id to preserve exact digits in JavaScript. |
media_user_id | integer | Publisher user identifier returned as an integer. |
video_count | integer | Number of videos reported for the article. |
audio_id | string | Audio identifier returned with the article as text. |
h5_extra | object | Public article, publisher, and engagement metadata. |
h5_extra.title | string | Title returned for the article. |
h5_extra.name | string | Publisher name displayed with the article. |
h5_extra.source | string | Publisher attribution displayed with the article. |
h5_extra.src_link | string | Source link returned with the article, when available. |
h5_extra.avatar | string | Publisher avatar URL displayed with the article. |
h5_extra.publish_stamp | string | Publication instant as a Unix timestamp in seconds, returned as text. |
h5_extra.publish_time | string | Publication time displayed as text, sometimes without a year. Checked values match UTC+8. |
h5_extra.str_group_id | string | Article group identifier returned as text. Use this field to retain every digit when processing the ID. |
h5_extra.str_item_id | string | Article item identifier returned as text. Use this field to retain every digit when processing the ID. |
h5_extra.media_user_id | string | Publisher user identifier returned as text. |
h5_extra.is_original | boolean | Whether the article is marked as original. |
h5_extra.video_count | integer | Reported video count in the article display metadata. |
h5_extra.diversity | object | Display attribution accompanying the article. |
h5_extra.diversity.publish_loc_info | string | Publication location label returned for display. |
Publisher profiles19 fields
data.data.h5_extra
| Field | Type | Description |
|---|---|---|
media | object | Public publishing media profile accompanying the article. |
media.id | integer | Numeric identifier reported for the publishing media profile. |
media.creator_id | integer | Numeric creator identifier returned for the media profile. |
media.name | string | Display name returned for the media profile. |
media.description | string | Public profile description returned for the publisher. |
media.avatar_url | string | Avatar image URL returned for the media profile. |
media.auth_info | string | Public verification text displayed for the media profile. |
media.user_verified | boolean | Whether the media profile is marked as verified. |
media.v | boolean | Verification badge flag reported for the media profile. |
media.can_be_praised | boolean | Whether the platform reports that the publisher can receive appreciation. |
itemCell.userInfo | object | Public publisher profile supplied with the article card when available. |
itemCell.userInfo.userID | integer | Numeric user identifier returned for this public profile. |
itemCell.userInfo.mediaID | integer | Numeric media identifier returned for this public profile. |
itemCell.userInfo.mediaType | integer | Platform type code for this public media profile. |
itemCell.userInfo.name | string | Display name returned for this public user profile. |
itemCell.userInfo.description | string | Description text returned for this public user profile. |
itemCell.userInfo.avatarURL | string | Avatar image URL returned for this public user profile. |
itemCell.userInfo.userVerified | integer | Verification indicator returned for this user profile. |
itemCell.userInfo.verifiedContent | string | Verification description displayed for this user profile. |
Engagement counts8 fields
data.data.h5_extra.itemCell.itemCounter
Platform-reported engagement and display counts.
| Field | Type | Description |
|---|---|---|
readCount | integer | Reported read count for the article. |
showCount | integer | Reported display count for the article. |
commentCount | integer | Reported comment count for the article. |
diggCount | integer | Reported like count for the article. |
repinCount | integer | Reported bookmark count for the article. |
forwardCount | integer | Reported repost count for the article. |
shareCount | integer | Reported share count for the article. |
videoWatchCount | integer | Reported video watch count in the article metadata. |
Article images24 fields
data.data
| Field | Type | Description |
|---|---|---|
image_detail | array | Image details returned for the article. |
image_detail[].uri | string | Image resource identifier returned by Toutiao. |
image_detail[].url | string | Primary image URL returned for this variant. |
image_detail[].width | integer | Width of this image variant as reported. |
image_detail[].height | integer | Height of this image variant as reported. |
image_detail[].image_type | integer | Platform image type code for this variant. |
image_detail[].url_list | array | URLs reported for this image variant. The primary URL can also be present. |
image_detail[].url_list[].url | string | One image URL reported for this variant. |
main_image_list | array | Main image variants supplied for the article. |
main_image_list[].uri | string | Image resource identifier returned by Toutiao. |
main_image_list[].url | string | Primary image URL returned for this variant. |
main_image_list[].width | integer | Width of this image variant as reported. |
main_image_list[].height | integer | Height of this image variant as reported. |
main_image_list[].image_type | integer | Platform image type code for this variant. |
main_image_list[].url_list | array | URLs reported for this image variant. The primary URL can also be present. |
main_image_list[].url_list[].url | string | One image URL reported for this variant. |
origin_image_list | array | Original-image variants reported for the article. |
origin_image_list[].uri | string | Image resource identifier returned by Toutiao. |
origin_image_list[].url | string | Primary image URL returned for this variant. |
origin_image_list[].width | integer | Width of this image variant as reported. |
origin_image_list[].height | integer | Height of this image variant as reported. |
origin_image_list[].image_type | integer | Platform image type code for this variant. |
origin_image_list[].url_list | array | URLs reported for this image variant. The primary URL can also be present. |
origin_image_list[].url_list[].url | string | One image URL reported for this variant. |
Thumbnails and title images27 fields
data.data
| Field | Type | Description |
|---|---|---|
thumb_image | array | Thumbnail image variants returned for the article. |
thumb_image[].uri | string | Image resource identifier returned by Toutiao. |
thumb_image[].url | string | Primary image URL returned for this variant. |
thumb_image[].width | integer | Width of this image variant as reported. |
thumb_image[].height | integer | Height of this image variant as reported. |
thumb_image[].image_type | integer | Platform image type code for this variant. |
thumb_image[].url_list | array | URLs reported for this image variant. The primary URL can also be present. |
thumb_image[].url_list[].url | string | One image URL reported for this variant. |
webp_image_detail | array | Article image details returned in the WebP variant list. |
webp_image_detail[].uri | string | Image resource identifier returned by Toutiao. |
webp_image_detail[].url | string | Primary image URL returned for this variant. |
webp_image_detail[].width | integer | Width of this image variant as reported. |
webp_image_detail[].height | integer | Height of this image variant as reported. |
webp_image_detail[].image_type | integer | Platform image type code for this variant. |
webp_image_detail[].url_list | array | URLs reported for this image variant. The primary URL can also be present. |
webp_image_detail[].url_list[].url | string | One image URL reported for this variant. |
webp_thumb_image | array | Thumbnail variants returned in the WebP variant list. |
webp_thumb_image[].uri | string | Image resource identifier returned by Toutiao. |
webp_thumb_image[].url | string | Primary image URL returned for this variant. |
webp_thumb_image[].width | integer | Width of this image variant as reported. |
webp_thumb_image[].height | integer | Height of this image variant as reported. |
webp_thumb_image[].image_type | integer | Platform image type code for this variant. |
webp_thumb_image[].url_list | array | URLs reported for this image variant. The primary URL can also be present. |
webp_thumb_image[].url_list[].url | string | One image URL reported for this variant. |
title_image | object | Article title image variants returned when available. |
title_image.title_image_url | string | Article title image URL for the default display. |
title_image.title_image_night_url | string | Article title image URL for the dark display mode. |
Audio5 fields
data.data.h5_extra.audio_info
Audio details attached to the article when available.
| Field | Type | Description |
|---|---|---|
audioID | integer | Numeric audio identifier reported with the audio metadata. |
audioGroupID | string | Group identifier returned for the audio as text. |
audioDuration | integer | Reported audio duration value. Its time unit is unconfirmed. |
audioWatchCount | integer | Reported listen count for the audio. |
audioWatchCountShowText | string | Display text returned for the audio listen count. |
Article card and sharing10 fields
data.data.h5_extra.itemCell
Article card data and reported engagement.
| Field | Type | Description |
|---|---|---|
articleBase | object | Public identifiers and version metadata for the article. |
articleBase.gidStr | string | Article group identifier returned as text. |
articleBase.articleVersion | integer | Version number reported for the article. |
articleBase.itemStatus | integer | Article status code reported by Toutiao. |
articleClassification | object | Public article classification fields returned by Toutiao. |
articleClassification.articleType | integer | Platform content type code for the article. |
articleClassification.articleSubType | integer | Platform content subtype code for the article. |
articleClassification.isOriginal | boolean | Whether the article is marked as original in its classification information. |
shareInfo | object | Public sharing information for the article. |
shareInfo.shareURL | string | Article share link returned by Toutiao. |
Platform status1 field
data
Toutiao article details and reported platform status.
| Field | Type | Description |
|---|---|---|
message | string | Status message returned with the Toutiao article result. |
Response Example
Loading the response example...