﻿---
title: Getting started with the API
description: The new typed client can be obtained from the elasticsearch package using the NewTypedClient function. This new API takes the same arguments as the previous...
url: https://www.elastic.co/elastic/docs-builder/docs/2423/reference/elasticsearch/clients/go/_getting_started_with_the_api
---

# Getting started with the API
The new typed client can be obtained from the `elasticsearch` package using the `NewTypedClient` function. This new API takes the same arguments as the previous one and uses the same transport underneath.
Connection to an Elasticsearch cluster is identical to the existing client, only the API changes:
```go
client, err := elasticsearch.NewTypedClient(elasticsearch.Config{
	// Proper configuration for your Elasticsearch cluster.
})
```

The code is generated from the [elasticsearch-specification](https://github.com/elastic/elasticsearch-specification).