How to Use Entity Autocomplete in Search Inputs
Offer recognized entity names and use the selected ID in a search
Written by Tasha Tatum
June 27, 2026
Updated October 16, 2026
How to use entity autocomplete in search inputs
Call /v1/suggest/entities with a prefix to show matching entity names as a user types. Let them choose the intended record, then pass its top-level id to entity.id in a news search.
curl "https://api.apitube.io/v1/suggest/entities?prefix=Tesla&api_key=YOUR_API_KEY"
Send your key through api_key or X-API-Key.
What does /v1/suggest/entities return?
The response is an array rather than a wrapped results object:
[
{
"id": 5012,
"name": "SpaceX",
"type": "organization",
"links": {
"self": "https://api.apitube.io/v1/news/entity/...",
"wikipedia": "https://en.wikipedia.org/wiki/SpaceX",
"wikidata": "https://www.wikidata.org/wiki/Q193701"
},
"metadata": {}
}
]
Each item includes its numeric ID, name, type, available links and metadata. Types include person, location, organization, brand, product, natural disaster, disease, event, sport and unknown.
Use the top-level ID for an entity filter. Follow supplied links as URLs rather than extracting another identifier from them.
How does prefix matching work?
prefix matches text anywhere in the name, ignoring case:
curl "https://api.apitube.io/v1/suggest/entities?prefix=micros&api_key=YOUR_API_KEY"
Results can include up to 100 matches. A more distinctive input narrows the choices. Waiting for two or three characters is useful for an app, but is not an API minimum-length requirement.
How to turn a suggestion into a news search
Use the ID the user selected:
curl "https://api.apitube.io/v1/news/everything?entity.id=5012&api_key=YOUR_API_KEY"
entity.id accepts up to three numeric IDs with OR, each 1–30 characters. A well-formed ID with no matches can return an empty list. See entity searches.
What errors can the endpoint return?
A missing prefix returns 400 ER0346; a missing key returns 401 ER0201. An unsupported type returns ER0356.
For a type-specific input, pass a supported type such as type=person or type=organization. Debounce input by waiting briefly after typing pauses, and keep requests within your account’s rate limit.
Categories, topics and industries have their own suggest endpoints. See the parameter reference.
Common Questions
- Does prefix have to be the start of the name?
- How many suggestions are returned?
- Which ID do I pass to entity.id?
- Can I autocomplete only people or only companies?
Does prefix have to be the start of the name?
No. It matches any part of the name, ignoring case.
How many suggestions are returned?
Up to 100. Refine the input rather than treating the first matches as a popularity ranking.
Which ID do I pass to entity.id?
The top-level id of the selected suggestion. Check its name and type before using it.
Can I autocomplete only people or only companies?
Yes. Use type=person or type=organization; brands have their own brand type. You can also inspect types in the returned array. For profiles, see the people directory.