Skip to content

Suggest Entities ​

Send the beginning of a person, company or other entity name to /v1/suggest/entities. Use the matches to suggest names in a search box.

Sign up at APITube to get your API key. Include it with every API request.

Endpoint ​

GET /v1/suggest/entities

Matches include an ID, type, name, and Wikipedia and Wikidata links.

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 response is an array of entities:

json
[
  {
    "id": 0,
    "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
  • sport - Sports
  • unknown - Type could not be determined

Response Fields ​

FieldTypeDescription
idintegerUnique 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 ​

bash
curl "https://api.apitube.io/v1/suggest/entities?prefix=elon&api_key=YOUR_API_KEY"
python
import requests

resp = requests.get(
    "https://api.apitube.io/v1/suggest/entities",
    params={"prefix": "elon", "api_key": "YOUR_API_KEY"},
)
print(resp.json())
javascript
const params = new URLSearchParams({ prefix: "elon", api_key: "YOUR_API_KEY" });
const resp = await fetch(`https://api.apitube.io/v1/suggest/entities?${params}`);
console.log(await resp.json());
php
$query = http_build_query(["prefix" => "elon", "api_key" => "YOUR_API_KEY"]);
$data = json_decode(file_get_contents("https://api.apitube.io/v1/suggest/entities?$query"), true);
print_r($data);
go
package main

import (
	"encoding/json"
	"fmt"
	"io"
	"net/http"
	"net/url"
)

func main() {
	u, _ := url.Parse("https://api.apitube.io/v1/suggest/entities")
	q := u.Query()
	q.Set("prefix", "elon")
	q.Set("api_key", "YOUR_API_KEY")
	u.RawQuery = q.Encode()

	resp, _ := http.Get(u.String())
	defer resp.Body.Close()

	body, _ := io.ReadAll(resp.Body)
	var data map[string]any
	json.Unmarshal(body, &data)
	fmt.Println(data)
}
java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Example {
    public static void main(String[] args) throws Exception {
        HttpClient client = HttpClient.newHttpClient();
        HttpRequest request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.apitube.io/v1/suggest/entities?prefix=elon&api_key=YOUR_API_KEY"))
            .GET()
            .build();
        HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.body());
    }
}
text
Write a script in your preferred language that calls the APITube News API:

GET https://api.apitube.io/v1/suggest/entities?prefix=elon

Read the API key from an environment variable (do not hardcode it), handle request
errors, and print the key fields of each result.
Docs: https://docs.apitube.io/platform/news-api/everything

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": 123,
    "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": 500,
    "name": "Apple",
    "type": "product",
    "links": {
      "self": "https://api.apitube.io/v1/news/entity/500",
      "wikipedia": "https://en.wikipedia.org/wiki/Apple",
      "wikidata": "https://www.wikidata.org/wiki/Q89"
    },
    "metadata": {}
  }
]

Error Responses ​

Missing API Key ​

json
{
  "errors": [
    {
      "code": "ER0201",
      "message": "API key is required. Provide it via X-API-Key header or api_key query parameter."
    }
  ]
}

Status Code: 401

Invalid API Key ​

json
{
  "errors": [
    {
      "code": "ER0202",
      "message": "API key is invalid."
    }
  ]
}

Status Code: 401

Missing Prefix Parameter ​

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

Status Code: 400