Skip to content

Suggest Entities

The /v1/suggest/entities endpoint provides autocomplete functionality for searching entities by name prefix. This endpoint is useful for building search interfaces with entity suggestions.

To use the API, you'll require an API key. You can obtain an API key by signing up for an account on the APITube website.

Endpoint

GET /v1/suggest/entities

This endpoint returns a list of entities matching the provided name prefix. Results include entity details such as type, name, and links to external resources like Wikipedia and Wikidata.

Query Parameters

ParameterTypeRequiredDescription
prefixstringYesThe name prefix to search for. Minimum 1 character.
api_keystringYes*Your API key. Can also be provided via headers.

* Required if not provided in headers

Response Format

The endpoint returns an array of entity objects with the following structure:

json
[
  {
    "id": "string",
    "name": "string",
    "type": "string",
    "links": {
      "self": "string",
      "wikipedia": "string",
      "wikidata": "string"
    },
    "metadata": {}
  }
]

Entity Types

Entities can be one of the following types:

  • person - Individual people
  • location - Geographic locations
  • organization - Companies, institutions, and organizations
  • brand - Commercial brands
  • product - Products and services
  • natural-disaster - Natural disasters and catastrophic events
  • disease - Diseases and medical conditions
  • event - Notable events

Response Fields

FieldTypeDescription
idstringUnique identifier for the entity
namestringName of the entity
typestringType of entity (see Entity Types above)
links.selfstringURL to get news articles about this entity
links.wikipediastringWikipedia page URL (if available)
links.wikidatastringWikidata page URL (if available)
metadataobjectAdditional metadata about the entity (varies by entity type)

Request Examples

Using query parameter

shell
curl "https://api.apitube.io/v1/suggest/entities?prefix=elon&api_key=YOUR_API_KEY"

Using header authentication

shell
curl -H "X-API-Key: YOUR_API_KEY" \
  "https://api.apitube.io/v1/suggest/entities?prefix=tesla"

Using Bearer token

shell
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.apitube.io/v1/suggest/entities?prefix=apple"

Response Example

json
[
  {
    "id": "Q312",
    "name": "Apple Inc.",
    "type": "organization",
    "links": {
      "self": "https://api.apitube.io/v1/news/entity/123",
      "wikipedia": "https://en.wikipedia.org/wiki/Apple_Inc.",
      "wikidata": "https://www.wikidata.org/wiki/Q312"
    },
    "metadata": {
      "headquarters": {
        "city": "Cupertino",
        "country": "United States"
      },
      "founded": "1976",
      "industry": "Technology"
    }
  },
  {
    "id": "Q89",
    "name": "Apple",
    "type": "product",
    "links": {
      "self": "https://api.apitube.io/v1/news/entity/456",
      "wikipedia": "https://en.wikipedia.org/wiki/Apple",
      "wikidata": "https://www.wikidata.org/wiki/Q89"
    },
    "metadata": {}
  }
]

Error Responses

Missing API Key

json
{
  "errors": [
    {
      "code": "ER0200",
      "message": "API key is required."
    }
  ]
}

Status Code: 400

Invalid API Key

json
{
  "errors": [
    {
      "code": "ER0201",
      "message": "API key not found."
    }
  ]
}

Status Code: 404

Missing Prefix Parameter

json
{
  "errors": [
    {
      "code": "ER0248",
      "message": "`Prefix` in query required."
    }
  ]
}

Status Code: 400