> ## Documentation Index
> Fetch the complete documentation index at: https://hexagraph-docs.voyla.in/llms.txt
> Use this file to discover all available pages before exploring further.

# Autocomplete

> Fast type-ahead search suggestions for Hexagraph entities.

Provides fast search suggestions for type-ahead inputs. Supports both global entity search and entity-specific search filtering.

### Endpoints

* `GET /autocomplete?query={search_string}` — Global type-ahead search across all 10 entity modules.
* `GET /autocomplete/{entity_type}?query={search_string}` — Entity-specific type-ahead search (e.g. `/autocomplete/institutions?query=Florida`, `/autocomplete/authors?query=Aspuru`).

Allowed `entity_type` values: `outputs`, `authors`, `sources`, `institutions`, `publishers`, `funders`, `topics`.

### Query Parameters

<ParamField query="query" type="string" required>
  Search query string (e.g. `Florida` or `crispr`).
</ParamField>

### Response Fields

<ResponseField name="meta" type="object" required>
  Query metadata wrapper.

  <Expandable title="meta attributes">
    <ResponseField name="count" type="integer">Total matching candidate count.</ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="results" type="array" required>
  Array of matching entity candidates.

  <Expandable title="results item attributes">
    <ResponseField name="id" type="string" required>Entity ID prefixed with `HX_` or numeric ID (e.g. `HX_I33213144`).</ResponseField>
    <ResponseField name="name" type="string" required>Human-readable display name (e.g. `"University of Florida"`).</ResponseField>
    <ResponseField name="cited_by_count" type="integer">Associated total citation count.</ResponseField>
    <ResponseField name="entity_type" type="string" required>Matched entity type (`institution`, `author`, `output`, `source`, `publisher`, `funder`, `topic`, `domain`, `field`, `subfield`).</ResponseField>
    <ResponseField name="external_id" type="string">Primary external identifier (e.g. ROR, DOI, ORCID URL).</ResponseField>
    <ResponseField name="outputs_count" type="integer">Associated total publication output count.</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash Global Autocomplete theme={null}
  curl -X GET "https://api.hexagraph.in/autocomplete?query=Florida"
  ```

  ```bash Entity Autocomplete theme={null}
  curl -X GET "https://api.hexagraph.in/autocomplete/institutions?query=Florida"
  ```

  ```javascript JavaScript theme={null}
  // Global Autocomplete
  fetch("https://api.hexagraph.in/autocomplete?query=Florida")
    .then(response => response.json())
    .then(data => console.log(data));

  // Entity-Specific Autocomplete
  fetch("https://api.hexagraph.in/autocomplete/institutions?query=Florida")
    .then(response => response.json())
    .then(data => console.log(data));
  ```

  ```python Python theme={null}
  import requests

  # Global Autocomplete
  res_global = requests.get("https://api.hexagraph.in/autocomplete", params={"query": "Florida"})
  print(res_global.json())

  # Entity-Specific Autocomplete
  res_entity = requests.get("https://api.hexagraph.in/autocomplete/institutions", params={"query": "Florida"})
  print(res_entity.json())
  ```
</RequestExample>

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "meta": {
      "count": 48990
    },
    "results": [
      {
        "id": "HX_I33213144",
        "name": "University of Florida",
        "cited_by_count": 31005110,
        "entity_type": "institution",
        "external_id": "https://ror.org/02y3ad647",
        "outputs_count": 364546
      }
    ]
  }
  ```

  ```json 400 Bad Request theme={null}
  {
    "statusCode": 400,
    "message": "Query parameter 'query' is required",
    "error": "Bad Request"
  }
  ```

  ```json 429 Too Many Requests theme={null}
  {
    "statusCode": 429,
    "error": "Too Many Requests",
    "message": "IP rate limit exceeded (max 30 requests per minute). Please try again in 42 seconds (at 11:40:32 UTC).",
    "reset_in_seconds": 42,
    "reset_at_utc": "2026-08-05T11:40:32.000Z"
  }
  ```
</ResponseExample>
