Elastic Search API

Search and query operations across indices.

GitHub OpenAPI
Pull this API's OpenAPI, operations, scores and pricing into your own code or AI agent with a free APIs.io key — sign in with GitHub, Google or LinkedIn. No form to fill in; signing in shares your email address with us (Privacy).

Operations 55

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /_search Search every index with a quick text query · Search across all indices #
Ask an LLM
“Can I run a quick keyword lookup across every index in my cluster from the URL?”
“How many hits come back from a simple q= search over all indices?”
Tell an agent
Do a quick query-string search for {q} across all indices.
Search all indices for {q} and return {size} hits.
POST /_search Run a full query DSL search across the cluster · Run a search #
Ask an LLM
“How do I send a query DSL body with aggregations to search the whole cluster in Elasticsearch?”
“Can I get highlighted hits and aggregations from every index in one POST search?”
Tell an agent
POST a search across the cluster using the query {query}.
Search the whole cluster with query {query} and aggregations {aggregations}.
GET /{index}/_search Search one index with a quick text query · Search a specific index #
Ask an LLM
“What's the fastest way to look up a keyword in just one index?”
“Can I search a single index using only a q= parameter in the URL?”
Tell an agent
Do a quick query-string search of index {index}.
Look up {q} in index {index} with a simple URL search.
POST /{index}/_search Run a full query DSL search on an index · Run a search #
Ask an LLM
“How do I POST a query DSL body against one specific index?”
“Can I run a kNN or aggregation search scoped to a single index?”
Tell an agent
POST a query DSL search to index {index}.
Search index {index} with query {query} and sort by {sort}.
GET /_async_search/{id} Fetch results of an async search · Get async search results #
Ask an LLM
“How do I retrieve the hits from an async search I submitted earlier?”
“Can I pick up partial results of a long-running async search?”
Tell an agent
Get the results of async search {id}.
Fetch whatever hits async search {id} has collected so far.
DELETE /_async_search/{id} Delete an async search and its results · Delete an async search #
Ask an LLM
“How do I cancel a running async search and throw away its stored results?”
“What happens to stored results when I delete an async search?”
Tell an agent destructive · confirm first
Delete async search {id}.
Cancel async search {id} and discard its saved results.
GET /_async_search/status/{id} Check whether an async search is finished · Get the async search status #
Ask an LLM
“Is my async search still running, without downloading its hits?”
“Can I check completion status of an async search cheaply?”
Tell an agent
Check the status of async search {id}.
Tell me if async search {id} has completed yet.
POST /_async_search Start an async search across the cluster · Run an async search #
Ask an LLM
“How do I kick off a long-running search across all indices without waiting for it?”
“Can I submit a search that keeps running in the background cluster-wide?”
Tell an agent
Submit an async search across all indices with query {query}.
Start a background search of the whole cluster.
POST /{index}/_async_search Start an async search on an index · Run an async search #
Ask an LLM
“How do I submit a background search against one slow, large index?”
“Can I scope an async search to a specific index pattern?”
Tell an agent
Submit an async search on index {index}.
Start a background search of {index} using query {query}.
GET /_search/scroll Get the next scroll batch via GET · Run a scrolling search #
Ask an LLM
“Can I page through a scroll with a GET request carrying the scroll ID in the body?”
“How do I fetch the next page of a scroll search using GET?”
Tell an agent
Fetch the next scroll batch for scroll ID {scroll_id} using GET.
Use GET to continue scroll {scroll_id} for another {scroll}.
POST /_search/scroll Get the next scroll batch via POST · Run a scrolling search #
Ask an LLM
“How do I keep paging a large result set with scroll in Elasticsearch?”
“Can I extend the scroll keep-alive while fetching the next batch?”
Tell an agent
POST scroll ID {scroll_id} to get the next batch of hits.
Continue scroll {scroll_id} and keep it alive for {scroll}.
DELETE /_search/scroll Clear scroll contexts · Clear a scrolling search #
Ask an LLM
“How do I free the resources held by scroll searches I'm done with?”
“Can I clear several scroll contexts at once with a body?”
Tell an agent destructive · confirm first
Clear the scroll context {scroll_id}.
Release all my open scroll contexts.
GET /_search/scroll/{scroll_id} Get the next scroll batch by ID in the path (GET) · Run a scrolling search #
Ask an LLM
“Can I put the scroll ID in the URL path when fetching the next batch with GET?”
“Which scroll call takes the ID as a path segment over GET?”
Tell an agent
GET the next batch for scroll {scroll_id} passing the ID in the path.
With GET, page scroll {scroll_id} from the path and keep it alive {scroll}.
POST /_search/scroll/{scroll_id} Get the next scroll batch by ID in the path (POST) · Run a scrolling search #
Ask an LLM
“Can I POST to a scroll URL that includes the scroll ID in the path?”
“Which scroll endpoint accepts the ID in the path over POST?”
Tell an agent
POST to the path-based scroll endpoint for {scroll_id}.
Page path-style scroll {scroll_id} via POST, extending it {scroll}.
DELETE /_search/scroll/{scroll_id} Clear one scroll context by ID in the path · Clear a scrolling search #
Ask an LLM
“Can I delete a single scroll context by putting its ID in the URL?”
“How do I clear a specific scroll using the path form?”
Tell an agent destructive · confirm first
Clear scroll {scroll_id} via the path-based endpoint.
Delete the scroll context named {scroll_id} in the URL.
DELETE /_pit Close a point in time · Close a point in time #
Ask an LLM
“How do I release a point-in-time I opened for paginated search?”
“Do open point-in-time snapshots keep segments alive until I close them?”
Tell an agent destructive · confirm first
Close point in time {id}.
Release the PIT {id} so its resources are freed.
GET /_count Count matching documents cluster-wide via GET · Count search results #
Ask an LLM
“Can I count documents across all indices with a simple GET?”
“How many documents exist in the whole cluster right now?”
Tell an agent
GET a count of all documents across the cluster.
GET how many docs match q={q} cluster-wide.
POST /_count Count documents matching a query cluster-wide · Count search results #
Ask an LLM
“How do I count documents across every index that match a query body?”
“Can I get just a hit count instead of hits for a cluster-wide query?”
Tell an agent
Count documents in all indices matching {query}.
Tell me how many documents across all indices satisfy {query}.
GET /{index}/_count Count documents in an index via GET · Count search results #
Ask an LLM
“How many documents are in a given index?”
“Can I get a document count for one index with a plain GET?”
Tell an agent
GET the document count for index {index}.
GET how many docs in {index} match q={q}.
POST /{index}/_count Count documents in an index matching a query · Count search results #
Ask an LLM
“How many documents in one index match a specific query?”
“Can I count filtered results in an index without returning them?”
Tell an agent
Count documents in {index} that match {query}.
How many hits for {query} in index {index} — count them.
GET /{index}/_explain/{id} Explain a document's score via GET · Explain a document match result #
Ask an LLM
“Can I see why one document matched with a GET explain call?”
“Which call explains scoring using a URL query instead of a body?”
Tell an agent
GET a scoring explanation for document {id} in {index}.
Use GET to show why doc {id} in {index} matches q={q}.
POST /{index}/_explain/{id} Explain why a document matches a query · Explain a document match result #
Ask an LLM
“Why did a particular document match (or not match) my query?”
“How is the relevance score for one document computed?”
Tell an agent
Explain how document {id} in {index} scores against {query}.
Tell me why document {id} in {index} did not match {query}.
GET /_field_caps Get field capabilities cluster-wide via GET · Get the field capabilities #
Ask an LLM
“Can I list which fields are searchable and aggregatable across all indices with GET?”
“Which field types exist across my whole cluster?”
Tell an agent
GET field capabilities across all indices.
GET capabilities of fields {fields} cluster-wide via the query string.
POST /_field_caps Get capabilities for chosen fields cluster-wide · Get the field capabilities #
Ask an LLM
“Is a given field aggregatable in every index it appears in?”
“Can I filter field capabilities with an index filter in the body?”
Tell an agent
POST a field list {fields} to get capabilities across every index.
Check cluster-wide field capabilities for indices matching {index_filter}.
GET /{index}/_field_caps Get an index's field capabilities via GET · Get the field capabilities #
Ask an LLM
“What fields does one index have and how can they be queried?”
“Can I GET field capabilities scoped to a single index?”
Tell an agent
GET field capabilities for index {index}.
GET capabilities of fields {fields} in {index} via query string.
POST /{index}/_field_caps Get capabilities for chosen fields in an index · Get the field capabilities #
Ask an LLM
“Is a specific field searchable in a particular index?”
“Can I POST a field list to check capabilities in one index?”
Tell an agent
Check field capabilities of {fields} in index {index}.
POST an index filter {index_filter} to check field caps in {index}.
GET /_msearch Run several searches at once via GET · Run multiple searches #
Ask an LLM
“Can I send a multi-search over GET across all indices?”
“Which call runs a batch of searches cluster-wide using GET?”
Tell an agent
GET a multi-search batch across the cluster.
Use GET to run a multi-search across all indices with max {max_concurrent_searches} concurrent.
POST /_msearch Run a batch of searches in one request · Run multiple searches #
Ask an LLM
“How do I run many searches in a single round trip?”
“Can I send newline-delimited searches against different indices together?”
Tell an agent
Run this batch of searches in one multi-search request.
POST a multi-search covering several indices at once.
GET /{index}/_msearch Run several searches on an index via GET · Run multiple searches #
Ask an LLM
“Can I GET a multi-search that defaults to one index?”
“Which multi-search call uses GET with an index in the path?”
Tell an agent
GET a multi-search batch against index {index}.
Use GET to batch searches on {index} capped at {max_concurrent_searches} concurrent.
POST /{index}/_msearch Run a batch of searches against an index · Run multiple searches #
Ask an LLM
“How do I batch several queries against the same index?”
“Can a multi-search default to one index unless a header overrides it?”
Tell an agent
Run a multi-search batch against index {index}.
POST several queries for index {index} in one round trip.
GET /_msearch/template Run several templated searches via GET · Run multiple templated searches #
Ask an LLM
“Can I GET a batch of search-template executions cluster-wide?”
“Which call runs multiple search templates using GET?”
Tell an agent
GET a batch of templated searches across the cluster.
Use GET to execute templated searches cluster-wide.
POST /_msearch/template Run a batch of templated searches · Run multiple templated searches #
Ask an LLM
“How do I execute several stored search templates in one request?”
“Can I pass different params to multiple templates at once?”
Tell an agent
Run multiple search templates in one request.
POST a batch of templated searches across all indices.
GET /{index}/_msearch/template Run several templated searches on an index via GET · Run multiple templated searches #
Ask an LLM
“Can I GET multiple template searches scoped to one index?”
“Which templated multi-search uses GET with an index path?”
Tell an agent
GET a batch of templated searches on index {index}.
Use GET to run stored templates in bulk on {index}.
POST /{index}/_msearch/template Run a batch of templated searches on an index · Run multiple templated searches #
Ask an LLM
“How do I run several search templates against one index together?”
“Can I batch templated queries for a single index?”
Tell an agent
Run multiple templated searches against index {index}.
POST several template executions scoped to {index}.
POST /{index}/_pit Open a point in time on an index · Open a point in time #
Ask an LLM
“How do I get a consistent snapshot for deep pagination with search_after?”
“How long does a point in time stay alive?”
Tell an agent
Open a point in time on {index} kept alive for {keep_alive}.
Create a PIT for {index} lasting {keep_alive} so I can page consistently.
GET /_rank_eval Evaluate search ranking quality via GET · Evaluate ranked search results #
Ask an LLM
“Can I GET a ranking evaluation across all indices?”
“Which rank evaluation call uses GET without an index?”
Tell an agent
GET a ranking evaluation for requests {requests}.
Use GET to score ranking of {requests} with metric {metric} cluster-wide.
POST /_rank_eval Measure search relevance across the cluster · Evaluate ranked search results #
Ask an LLM
“How good is my search ranking measured against rated documents?”
“Can I compute precision or nDCG for a set of typical queries?”
Tell an agent
Evaluate ranking quality for {requests} using metric {metric}.
Compute relevance metrics for my rated queries {requests} across all indices.
GET /{index}/_rank_eval Evaluate an index's ranking via GET · Evaluate ranked search results #
Ask an LLM
“Can I GET a rank evaluation scoped to one index?”
“Which rank evaluation call takes an index over GET?”
Tell an agent
GET a ranking evaluation of {requests} on index {index}.
Use GET to rate ranking on {index} with metric {metric} for {requests}.
POST /{index}/_rank_eval Measure search relevance on an index · Evaluate ranked search results #
Ask an LLM
“How well does one index rank results for my rated queries?”
“Can I score relevance metrics for a single index?”
Tell an agent
Evaluate relevance on index {index} for rated requests {requests}.
Score {index} ranking with metric {metric} for {requests}.
GET /_render/template Render a search template via GET · Render a search template #
Ask an LLM
“Can I preview a rendered template with a GET request?”
“Which render-template call uses GET without an ID in the path?”
Tell an agent
GET the rendered query for an inline template source {source}.
Use GET to expand inline template {source} with {params}.
POST /_render/template Preview the query a template produces · Render a search template #
Ask an LLM
“What query does my search template actually generate with these params?”
“Can I debug a mustache search template without running it?”
Tell an agent
Render template source {source} with params {params}.
Show me the query generated by stored template body id {id}.
GET /_render/template/{id} Render a stored template by ID via GET · Render a search template #
Ask an LLM
“Can I GET the rendered output of a stored template by its ID?”
“Which call renders a saved template using GET with an ID path?”
Tell an agent
GET the rendered query of stored template {id}.
Use GET to expand saved template {id} with {params}.
POST /_render/template/{id} Render a stored template with params · Render a search template #
Ask an LLM
“What does a stored search template expand to with my parameters?”
“Can I test a saved template by ID before using it in a search?”
Tell an agent
Render stored template {id} with params {params}.
Preview what saved template {id} expands to before I search.
GET /{index}/_mvt/{field}/{zoom}/{x}/{y} Get a vector tile of geo data via GET · Search a vector tile #
Ask an LLM
“Can I GET a Mapbox vector tile for a geo field?”
“Which vector tile call uses GET for a tile coordinate?”
Tell an agent
GET vector tile {zoom}/{x}/{y} for field {field} in {index}.
Use GET to fetch tile z{zoom} x{x} y{y} of {field} from {index}.
POST /{index}/_mvt/{field}/{zoom}/{x}/{y} Search geo data as a map vector tile · Search a vector tile #
Ask an LLM
“How do I render geo_point data from an index as a map tile?”
“Can I add aggregations to a vector tile search?”
Tell an agent
Build vector tile {zoom}/{x}/{y} from {field} in {index} with aggregations {aggs}.
POST a vector tile request for {field} in {index} at {zoom}/{x}/{y} with buffer {buffer}.
GET /_search_shards List shards a cluster search would hit via GET · Get the search shards #
Ask an LLM
“Which nodes and shards would a search across all indices run on?”
“Can I GET the shard routing for a cluster-wide search?”
Tell an agent
GET the shards a cluster-wide search would target.
Use GET to show shard routing for a search of all indices with routing {routing}.
POST /_search_shards List shards a cluster search would hit via POST · Get the search shards #
Ask an LLM
“Can I POST to see shard targeting for a search of all indices?”
“Which search-shards call uses POST without an index?”
Tell an agent
POST to list the shards a search across all indices would use.
POST for shard targets of an all-indices search with routing {routing}.
GET /{index}/_search_shards List shards a search on an index would hit · Get the search shards #
Ask an LLM
“Which shards and nodes serve searches of one index?”
“Can I check routing before searching a particular index?”
Tell an agent
Show the shards a search of {index} would hit.
Which nodes would serve a search of {index} with routing {routing}.
POST /{index}/_search_shards List an index's search shards via POST · Get the search shards #
Ask an LLM
“Can I POST to get the search shards for one index?”
“Which search-shards call uses POST with an index path?”
Tell an agent
POST to list search shards for index {index}.
POST for shard targets of {index} with routing {routing}.
GET /_search/template Search with a template via GET · Run a search with a search template #
Ask an LLM
“Can I run a stored search template cluster-wide using GET?”
“Which template search uses GET without an index?”
Tell an agent
Use GET to run cluster-wide template {id} with no index in the path.
Use GET to search cluster-wide with template {id} and params {params}.
POST /_search/template Run a search from a template · Run a search with a search template #
Ask an LLM
“How do I run a stored mustache template with my parameters?”
“Can I reuse a saved query shape and just swap in values?”
Tell an agent
Search all indices with template {id} and params {params}.
POST a cluster-wide search with inline template {source}.
GET /{index}/_search/template Search an index with a template via GET · Run a search with a search template #
Ask an LLM
“Can I GET a templated search scoped to one index?”
“Which template search uses GET with an index path?”
Tell an agent
Using GET, apply template {id} only to index {index}.
Use GET to search {index} with template {id} and params {params}.
POST /{index}/_search/template Run a templated search on an index · Run a search with a search template #
Ask an LLM
“How do I apply a stored search template to a specific index?”
“Can I profile a templated search on one index?”
Tell an agent
Search {index} with template {id} and params {params}.
POST a search of {index} with inline template {source}.
GET /{index}/_terms_enum List field terms in an index via GET · Get terms in an index #
Ask an LLM
“Can I GET matching terms for a field to power autocomplete?”
“Which terms-enum call uses GET?”
Tell an agent
GET terms of field {field} in {index}.
Use GET to list up to {size} terms of {field} in {index}.
POST /{index}/_terms_enum Suggest terms from an index field · Get terms in an index #
Ask an LLM
“How do I get autocomplete suggestions for a keyword field?”
“Can term lookup be case-insensitive and capped by size?”
Tell an agent
List up to {size} terms from field {field} in {index}.
Suggest terms in {index}.{field} ignoring case.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/elastic:elastic-search-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. By signing up you are subscribing to the APIs.io and API Evangelist newsletters — you can unsubscribe from any issue. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

elastic-search-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Elastic Search API
  version: '1.0'
  description: 'Operations tagged Search across 2 of this provider''s published API definitions: elastic-elasticsearch-openapi.yml, elasticsearch.json. Each path carries the servers of the definition it was published in.'
servers:
- url: https://{deployment}.es.{region}.cloud.es.io:9243
  description: Elastic Cloud deployment
  variables:
    deployment:
      default: my-deployment
      description: Deployment identifier
    region:
      default: us-east-1
      description: Cloud region
- url: http://localhost:9200
  description: Local Elasticsearch
tags:


# --- truncated at 32 KB (1005 KB total) ---
# Full source: https://artifacts.apis.io/elastic/openapi/elastic-search-api-openapi.yml