Comment on page
The autocomplete endpoint lets you add autocomplete or typeahead components to your applications, without the overhead of hosting your own API endpoint.
Each endpoint takes a string, and (very quickly) returns a list of entities that match that string.
Here's an example of an autocomplete component that lets users quickly select an institution:
A user looking for information on the flagship of Florida's state university system.
The autocomplete endpoint is very fast; queries generally return in around 200ms. If you'd like to see it in action, we're using a slightly-modified version of this endpoint in the OpenAlex website here: https://explore.openalex.org/
The format for requests is simple:
entity_type(optional): the name of one of the OpenAlex entities:
query: the search string supplied by the user.
Each request returns a response object with two properties:
meta: an object with information about the request, including timing and results count
results: a list of up to ten results for the query, sorted by citation count. Each result represents an entity that matched against the query.
display_name: "University of Florida",
hint: "Gainesville, USA",
// more results...
Each object in the
resultslist includes these properties:
display_name(string): The entity's
entity_type(string): The entity's type:
cited_by_count(integer): The entity's
cited_by_countproperty. For works this is simply the number of incoming citations. For other entities, it's the sum of incoming citations for all the works linked to that entity.
works_count(integer): The number of works associated with the entity. For entity type
workit's always null.
hint: Some extra information that can help identify the right item. Differs by entity type.
Result objects have a
hintproperty. You can show this to users to help them identify which item they're selecting. This is particularly helpful when the
display_namevalues of different results are the same, as often happens when autocompleting an author entity--a user who types in
John Smiis going to see a lot of identical-looking results, even though each one is a different person.
The content of the
hintproperty varies depending on what kind of entity you're looking up:
Work: The work's authors' display names, concatenated. e.g. "R. Alexander Pyron, John J. Wiens"
host_organization, e.g. "Oxford University Press"
Institution: The institution's location, e.g. "Gainesville, USA"
- The query
https://api.openalex.org/autocomplete?q=https://orcid.org/0000-0002-7436-3176will search for the author with ORCID ID
https://orcid.org/0000-0002-7436-3176and return 0 records if it does not exist.