algolia/algoliasearch-client-go

⚡️ A fully-featured and blazing-fast Go API client to interact with Algolia.

Go

200

1,786 commits

updated Oct 9, 2026

See the code

README

Algolia for Go

The perfect starting point to integrate Algolia within your Go project

Github Releases GoDoc Go Report Card License Supported version

Documentation • Community Forum • Stack Overflow • Report a bug • Support

✨ Features

  • Support Go 1.19 and above
  • Typed requests and responses
  • First-class support for user-defined structures
  • Injectable HTTP client

💡 Getting Started

First, install the Algolia API Go Client via the go get command:

go get github.com/algolia/algoliasearch-client-go/v4

You can now import the Algolia API client in your project and play with it.

import "github.com/algolia/algoliasearch-client-go/v4/algolia/search"

client, err := search.NewClient("YOUR_APP_ID", "YOUR_API_KEY")

// Add a new record to your Algolia index
response, err := client.SaveObject(client.NewApiSaveObjectRequest(
  "<YOUR_INDEX_NAME>", map[string]any{"objectID": "id", "test": "val"},
))
if err != nil {
  // handle the eventual error
  panic(err)
}

// use the model directly
print(response)

// Poll the task status to know when it has been indexed
taskResponse, err := searchClient.WaitForTask("<YOUR_INDEX_NAME>", response.TaskID, nil, nil, nil)
if err != nil {
  panic(err)
}

// Fetch search results, with typo tolerance
response, err := client.Search(client.NewApiSearchRequest(

  search.NewEmptySearchMethodParams().SetRequests(
    []search.SearchQuery{*search.SearchForHitsAsSearchQuery(
      search.NewEmptySearchForHits().SetIndexName("<YOUR_INDEX_NAME>").SetQuery("<YOUR_QUERY>").SetHitsPerPage(50))}),
))
if err != nil {
  // handle the eventual error
  panic(err)
}

// use the model directly
print(response)

For full documentation, visit the Algolia Go API Client.

❓ Troubleshooting

Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client. You can also open a GitHub issue

Contributing

This repository hosts the code of the generated Algolia API client for Go, if you'd like to contribute, head over to the main repository. You can also find contributing guides on our documentation website.

📄 License

The Algolia Go API Client is an open-sourced software licensed under the MIT license.

algolia
algolia-search
api-client
go
search

algolia/algoliasearch-client-go

⚡️ A fully-featured and blazing-fast Go API client to interact with Algolia.

Go

200

1,786 commits

updated Oct 9, 2026

See the code

README

Algolia for Go

The perfect starting point to integrate Algolia within your Go project

Github Releases GoDoc Go Report Card License Supported version

Documentation • Community Forum • Stack Overflow • Report a bug • Support

✨ Features

  • Support Go 1.19 and above
  • Typed requests and responses
  • First-class support for user-defined structures
  • Injectable HTTP client

💡 Getting Started

First, install the Algolia API Go Client via the go get command:

go get github.com/algolia/algoliasearch-client-go/v4

You can now import the Algolia API client in your project and play with it.

import "github.com/algolia/algoliasearch-client-go/v4/algolia/search"

client, err := search.NewClient("YOUR_APP_ID", "YOUR_API_KEY")

// Add a new record to your Algolia index
response, err := client.SaveObject(client.NewApiSaveObjectRequest(
  "<YOUR_INDEX_NAME>", map[string]any{"objectID": "id", "test": "val"},
))
if err != nil {
  // handle the eventual error
  panic(err)
}

// use the model directly
print(response)

// Poll the task status to know when it has been indexed
taskResponse, err := searchClient.WaitForTask("<YOUR_INDEX_NAME>", response.TaskID, nil, nil, nil)
if err != nil {
  panic(err)
}

// Fetch search results, with typo tolerance
response, err := client.Search(client.NewApiSearchRequest(

  search.NewEmptySearchMethodParams().SetRequests(
    []search.SearchQuery{*search.SearchForHitsAsSearchQuery(
      search.NewEmptySearchForHits().SetIndexName("<YOUR_INDEX_NAME>").SetQuery("<YOUR_QUERY>").SetHitsPerPage(50))}),
))
if err != nil {
  // handle the eventual error
  panic(err)
}

// use the model directly
print(response)

For full documentation, visit the Algolia Go API Client.

❓ Troubleshooting

Encountering an issue? Before reaching out to support, we recommend heading to our FAQ where you will find answers for the most common issues and gotchas with the client. You can also open a GitHub issue

Contributing

This repository hosts the code of the generated Algolia API client for Go, if you'd like to contribute, head over to the main repository. You can also find contributing guides on our documentation website.

📄 License

The Algolia Go API Client is an open-sourced software licensed under the MIT license.

algolia
algolia-search
api-client
go
search

Project health

Overall

5.0/10

Maintained

10/10

Code review

0/10
OpenSSF Scorecard

Latest release

v4.47.0 · Sep 9, 2026

Releases this year

29

Significant stargazers

Sylvain Utard

376 followers · starred May 2019

Geoffrey Grosenbach

1,528 followers · starred Dec 2017

Nico Stapelbroek

86 followers · starred Oct 2017