Skip to content

API Response Structure

This page contains detailed information about the structure of the APITube API response, including description of all fields and their possible values.

General response structure

All APITube responses are returned in JSON format and have the following general structure:

json
{
    "status": "ok",
    "page": 1,
    "path": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=2",
    "has_next_pages": true,
    "next_page": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=3",
    "has_previous_page": false,
    "previous_page": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1",
    "export": {
        "json": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=json",
        "xlsx": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=xlsx",
        "csv": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=csv",
        "tsv": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=tsv",
        "xml": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=xml"
    },
    "request_id": "5978d89c-46f6-4ab4-b65c-8b4a6000d4ac",
    "results": [
        // Array of articles
    ]
}

Main response fields

FieldTypeDescription
statusstringRequest status. Possible values: "ok" (request successful) or "error" (an error occurred).
pageintegerCurrent page of results.
pathstringFull URL of the current API request, including all request parameters.
has_next_pagesbooleanFlag indicating the presence of next pages of results (true - there are next pages).
next_pagestringFull URL to get the next page of results. Absent if has_next_pages is false.
has_previous_pagebooleanFlag indicating the presence of previous pages of results (true - there are previous pages).
previous_pagestringFull URL to get the previous page of results. Absent if has_previous_page is false.
exportobjectObject with URLs for exporting results in various formats (json, xlsx, csv, tsv, xml).
request_idstringUnique request identifier for tracking and debugging.
resultsarrayArray with request results (articles).

Article object fields

Each article in the results array has the following structure:

json
{
    "id": "Unique article ID",
    "href": "URL of the original article",
    "published_at": "Publication date and time in ISO 8601 format",
    "title": "Article title",
    "description": "Brief article description",
    "body": "Full article text",
    "language": "Article language (ISO 639-1 code)",
    "author": {
        "id": "Author ID",
        "name": "Author name"
    },
    "image": "URL of the main article image",
    "categories": [
        {
            "id": "Category ID",
            "name": "Category name",
            "score": "Category relevance score for the article",
            "taxonomy": "Category taxonomy name",
            "links": {
                "self": "URL to get information about the category"
            }
        }
    ],
    "topics": "Array of topics related to the article",
    "industries": [
        {
            "id": "Industry ID",
            "name": "Industry name",
            "links": {
                "self": "URL to get information about the industry"
            }
        }
    ],
    "entities": [
        {
            "id": "Entity ID",
            "name": "Entity name",
            "links": {
                "self": "URL to get information about the entity",
                "wikipedia": "Link to Wikipedia article",
                "wikidata": "Link to entity in Wikidata"
            },
            "types": "Array of entity types (human, location, organization, etc.)",
            "language": "Entity language",
            "frequency": "Frequency of entity mentions in the article",
            "title": {
                "pos": "Array of entity mention positions in the title"
            },
            "body": {
                "pos": "Array of entity mention positions in the article body"
            }
        }
    ],
    "source": {
        "id": "Source ID",
        "domain": "Source domain",
        "home_page_url": "URL of the source homepage",
        "type": "Source type (news, blog, etc.)",
        "rankings": {
            "opr": "Source ranking"
        },
        "location": {
            "country_name": "Source country name",
            "country_code": "Source country code (ISO 3166-1 alpha-2)"
        },
        "favicon": "Source favicon URL"
    },
    "sentiment": {
        "overall": {
            "score": "Overall article sentiment score",
            "polarity": "Textual representation of sentiment (positive, negative, neutral)"
        },
        "title": {
            "score": "Title sentiment score",
            "polarity": "Textual representation of title sentiment"
        },
        "body": {
            "score": "Article body sentiment score",
            "polarity": "Textual representation of body sentiment"
        }
    },
    "summary": [
        {
            "sentence": "Key sentence from the article",
            "sentiment": {
                "score": "Sentence sentiment score",
                "polarity": "Textual representation of sentiment"
            }
        }
    ],
    "keywords": "Array of article keywords",
    "links": "Array of URLs mentioned in the article",
    "media": [
        {
            "url": "Media file URL",
            "type": "Media file type (image, video, etc.)",
            "format": "Media file format (jpeg, png, mp4, etc.)"
        }
    ],
    "story": {
        "id": "Story ID",
        "uri": "URL to get information about the story"
    },
    "is_duplicate": "Flag indicating if the article is a duplicate",
    "is_paywall": "Flag indicating if the article is behind a paywall",
    "sentences_count": "Number of sentences in the article",
    "paragraphs_count": "Number of paragraphs in the article",
    "words_count": "Number of words in the article",
    "characters_count": "Number of characters in the article"
}

Detailed description of article fields

FieldTypeDescription
idintegerUnique article identifier in the APITube system.
hrefstringURL of the original article.
titlestringArticle headline.
descriptionstringBrief description or annotation of the article. May be absent for some articles.
bodystringFull article text without HTML tags.
published_atstringDate and time of article publication in ISO 8601 format.
languagestringArticle language in ISO 639-1 format (two-letter code).
authorobjectInformation about the article author.
imagestringURL of the main article image. May be absent for some articles.
categoriesarrayArray of categories the article belongs to.
topicsarrayArray of topics related to the article.
industriesarrayArray of industries related to the article content.
entitiesarrayArray of objects with information about entities (people, places, organizations, etc.) mentioned in the article.
sourceobjectInformation about the article source.
sentimentobjectArticle sentiment assessment.
summaryarrayArray of objects containing key sentences from the article with their sentiment assessment.
keywordsarrayArray of keywords extracted from the article.
linksarrayArray of URLs mentioned in the article.
mediaarrayArray of objects containing information about media files (images, videos) related to the article.
storyobjectInformation about the story the article belongs to (id and uri).
is_duplicatebooleanIndicates if the article is a duplicate of another article.
is_paywallbooleanIndicates if the article is behind a paywall.
sentences_countintegerNumber of sentences in the article.
paragraphs_countintegerNumber of paragraphs in the article.
words_countintegerNumber of words in the article.
characters_countintegerNumber of characters in the article.

Detailed description of nested objects

Category object

json
{
    "id": "IAB19",
    "name": "Technology & Computing",
    "score": 0.5,
    "taxonomy": "iab-qag",
    "links": {
        "self": "https://api.apitube.io/v1/news/category/iab-qag/IAB19"
    }
}
FieldTypeDescription
idstringUnique category identifier.
namestringCategory name.
scorefloatCategory relevance score for the article (from 0 to 1).
taxonomystringName of the taxonomy the category belongs to.
linksobjectObject with links related to the category.

Industry object

json
{
    "id": 1067,
    "name": "Sporting event",
    "links": {
        "self": "https://api.apitube.io/v1/news/industry/1067"
    }
}
FieldTypeDescription
idintegerUnique industry identifier.
namestringIndustry name.
linksobjectObject with links related to the industry.

Entity object

json
{
    "id": 798377,
    "name": "Juan Medina",
    "links": {
        "self": "https://api.apitube.io/v1/news/entity/798377",
        "wikipedia": "https://en.wikipedia.org/wiki/Juan_Medina",
        "wikidata": "https://www.wikidata.org/wiki/Q5573426"
    },
    "types": ["human"],
    "language": "en",
    "frequency": 1,
    "title": {
        "pos": [{
            "start": 102,
            "end": 113
        }]
    },
    "body": {
        "pos": [{
            "start": 102,
            "end": 113
        }]
    }
}
FieldTypeDescription
idintegerUnique entity identifier.
namestringEntity name.
linksobjectObject with links to external resources related to the entity (API, Wikipedia, Wikidata).
typesarrayArray of entity types (e.g., "human", "location", "organization").
languagestringEntity language.
frequencyintegerFrequency of entity mentions in the article.
titleobjectInformation about entity mention positions in the article title.
bodyobjectInformation about entity mention positions in the article body.

Source object

json
{
    "id": 8540,
    "domain": "sports.inquirer.net",
    "home_page_url": "https://sports.inquirer.net",
    "type": "news",
    "rankings": {
        "opr": 5
    },
    "location": {
        "country_name": "Philippines",
        "country_code": "ph"
    },
    "favicon": "https://www.google.com/s2/favicons?domain=https://sports.inquirer.net"
}
FieldTypeDescription
idintegerUnique source identifier.
domainstringSource domain.
home_page_urlstringURL of the source homepage.
typestringSource type (e.g., "news", "blog").
rankingsobjectSource ratings and metrics.
locationobjectInformation about the geographic location of the source.
faviconstringURL of the source favicon.

Sentiment object

json
{
    "overall": {
        "score": -0.01,
        "polarity": "neutral"
    },
    "title": {
        "score": -0.09,
        "polarity": "negative"
    },
    "body": {
        "score": 0.07,
        "polarity": "positive"
    }
}
FieldTypeDescription
overallobjectOverall article sentiment assessment.
titleobjectArticle title sentiment assessment.
bodyobjectArticle body sentiment assessment.

Each sentiment object contains:

  • score (float): numerical sentiment score (from -1 to 1, where negative values correspond to negative sentiment, and positive values to positive sentiment).
  • polarity (string): textual representation of sentiment ("positive", "negative", "neutral").

Media object

json
{
    "url": "https://sports.inquirer.net/files/2025/04/2025-04-24T150824Z_910329377_UP1EL4O161ZT2_RTRMADP_3_TENNIS-MADRID-620x420.jpg",
    "type": "image",
    "format": "jpeg"
}
FieldTypeDescription
urlstringMedia file URL.
typestringMedia file type (e.g., "image", "video").
formatstringMedia file format (e.g., "jpeg", "png", "mp4").

Error response

In case of an error, the API returns a response with status "error" and additional information about the error:

json
{
  "status": "error",
  "code": "invalid_api_key",
  "message": "Your API key is invalid or missing."
}
FieldTypeDescription
statusstringAlways "error" in case of an error.
codestringError code.
messagestringHuman-readable error message.

Error codes

CodeHTTP statusDescription
invalid_api_key401Invalid or missing API key.
unauthorized401Insufficient permissions to perform the request.
quota_exceeded429Request limit exceeded.
invalid_parameter400Invalid parameter value.
missing_parameter400Missing required parameter.
internal_error500Internal server error.

Pagination

For working with large datasets, the API uses pagination. By default, the first page of results is returned. To access other pages, use the page and limit/per_page parameters.

Example of pagination request:

https://api.apitube.io/v1/news/everything?title=technology&page=2&per_page=20

Response with pagination information:

json
{
  "status": "ok",
  "page": 2,
  "per_page": 20,
  "path": "https://api.apitube.io/v1/news/everything?title=technology&page=2&per_page=20",
  "has_next_pages": true,
  "next_page": "https://api.apitube.io/v1/news/everything?title=technology&page=3&per_page=20",
  "has_previous_page": true,
  "previous_page": "https://api.apitube.io/v1/news/everything?title=technology&page=1&per_page=20",
  "results": [
    // Article objects
  ]
}

API response example

json
{
  "status": "ok",
  "page": 1,
  "per_page": 2,
  "path": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1",
  "has_next_pages": true,
  "next_page": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=2",
  "has_previous_page": false,
  "export": {
    "json": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=json",
    "xlsx": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=xlsx",
    "csv": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=csv",
    "tsv": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=tsv",
    "xml": "https://api.apitube.io/v1/news/everything?language.code=en&per_page=2&page=1&export=xml"
  },
  "request_id": "a1b2c3d4-e5f6-7g8h-9i0j-k1l2m3n4o5p6",
  "results": [
    {
      "id": 12345678,
      "href": "https://example.com/tech/new-smartphone-release",
      "published_at": "2023-06-15T10:30:00Z",
      "title": "New XYZ Smartphone Makes Waves in the Market",
      "description": "XYZ Company has introduced a new flagship smartphone that significantly outperforms competitors in performance and camera quality.",
      "body": "Today, XYZ Company introduced its new flagship smartphone. The device is equipped with the latest generation processor and a revolutionary camera that, according to the manufacturer, is capable of taking professional quality photos even in low light conditions. Industry experts have already highly rated the novelty, noting its excellent performance and innovative features.",
      "language": "en",
      "author": {
        "id": 5678,
        "name": "John Smith"
      },
      "image": "https://example.com/images/xyz-smartphone.jpg",
      "categories": [
        {
          "id": "IAB19",
          "name": "Technology & Computing",
          "score": 0.8,
          "taxonomy": "iab-qag",
          "links": {
            "self": "https://api.apitube.io/v1/news/category/iab-qag/IAB19"
          }
        }
      ],
      "topics": [],
      "industries": [
        {
          "id": 456,
          "name": "Consumer Electronics",
          "links": {
            "self": "https://api.apitube.io/v1/news/industry/456"
          }
        }
      ],
      "entities": [
        {
          "id": 789,
          "name": "XYZ Company",
          "links": {
            "self": "https://api.apitube.io/v1/news/entity/789",
            "wikipedia": "https://en.wikipedia.org/wiki/XYZ_Company",
            "wikidata": "https://www.wikidata.org/wiki/Q12345"
          },
          "types": ["organization"],
          "language": "en",
          "frequency": 3,
          "title": {
            "pos": [
              {
                "start": 4,
                "end": 15
              }
            ]
          },
          "body": {
            "pos": [
              {
                "start": 6,
                "end": 17
              },
              {
                "start": 122,
                "end": 133
              }
            ]
          }
        }
      ],
      "source": {
        "id": 123,
        "domain": "example.com",
        "home_page_url": "https://example.com",
        "type": "news",
        "rankings": {
          "opr": 8
        },
        "location": {
          "country_name": "United States",
          "country_code": "us"
        },
        "favicon": "https://example.com/favicon.ico"
      },
      "sentiment": {
        "overall": {
          "score": 0.45,
          "polarity": "positive"
        },
        "title": {
          "score": 0.3,
          "polarity": "positive"
        },
        "body": {
          "score": 0.6,
          "polarity": "positive"
        }
      },
      "summary": [
        {
          "sentence": "Today, XYZ Company introduced its new flagship smartphone.",
          "sentiment": {
            "score": 0.2,
            "polarity": "positive"
          }
        },
        {
          "sentence": "Industry experts have already highly rated the novelty, noting its excellent performance and innovative features.",
          "sentiment": {
            "score": 0.8,
            "polarity": "positive"
          }
        }
      ],
      "keywords": ["smartphone", "XYZ", "technology"],
      "links": ["https://example.com/related/xyz-previous-model"],
      "media": [
        {
          "url": "https://example.com/images/xyz-smartphone.jpg",
          "type": "image",
          "format": "jpeg"
        },
        {
          "url": "https://example.com/videos/xyz-smartphone-preview.mp4",
          "type": "video",
          "format": "mp4"
        }
      ],
      "story": {
        "id": 9876,
        "uri": "https://api.apitube.io/v1/news/story/9876"
      },
      "is_duplicate": false,
      "is_paywall": false,
      "sentences_count": 3,
      "paragraphs_count": 1,
      "words_count": 60,
      "characters_count": 354
    }
  ]
}

Notes

  1. Field availability: Some fields may be absent from the response depending on data availability for a specific article or the subscription plan used.

  2. Date format: All dates in the API are returned in ISO 8601 format (e.g., "2023-06-15T10:30:00Z").

  3. Content limitations: Depending on the subscription plan, the body field may contain the full text of the article or only a part of it.

  4. Language and country: The language and country fields use standard ISO codes (ISO 639-1 for languages and ISO 3166-1 alpha-2 for countries).

  5. Sentiment: The score value ranges from -1 to 1, where negative values correspond to negative sentiment, and positive values to positive sentiment.