﻿---
title: Using the API
description: The examples in this section use the typed API together with the esdsl builders: the recommended way to use the Go client. The typed API gives you strongly...
url: https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/using-the-api
products:
  - Elasticsearch Client
  - Elasticsearch Go Client
---

# Using the API
The examples in this section use the [typed API](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/typed-api) together with the [`esdsl`](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/typed-api/esdsl) builders: the recommended way to use the Go client. The typed API gives you strongly typed request and response structs generated from the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification), and `esdsl` provides fluent, chainable builders for queries, aggregations, mappings, and sort options.
If you need raw-JSON control or an endpoint not yet covered by the typed API, see the [low-level API](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/low-level-api). The two APIs share the same transport, so you can mix them in the same application. See the [migration guide](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/low-level-api/migration) for how to adopt the typed API one endpoint at a time.

## Example

The same search operation, expressed with the typed API and `esdsl`:
```go
import "github.com/elastic/go-elasticsearch/v9/typedapi/esdsl"
```

```go
res, err := es.Search().
    Index("my-index").
    Query(esdsl.NewMatchQuery("title", "golang")).
    Do(context.Background())
if err != nil {
    log.Fatal(err)
}

for _, hit := range res.Hits.Hits {
    fmt.Println(hit.Source_)
}
```


## What's covered in this section

- [CRUD operations](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/using-the-api/crud-operations): index, get, update, and delete documents
- [Searching](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/using-the-api/searching): build and run search queries
- [Aggregations](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/using-the-api/aggregations): run aggregations on your data
- [Bulk indexing](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/using-the-api/bulk-indexing): efficiently ingest large volumes of documents
- [ES|QL](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/using-the-api/esql): use the Elasticsearch Query Language
- [Dense vectors and kNN search](https://www.elastic.co/elastic/docs-builder/docs/3175/reference/elasticsearch/clients/go/using-the-api/dense-vectors): work with vector embeddings and similarity search