Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

talk to adafruit io from Go

GoDoc Build Status

A go client library for talking to your account.

Requires go version 1.18 or better. Running tests uses the library. To run tests, run:

$ go test ./...


First, add the package:

$ go get

Then import it:

import ""

The io-client-go repository provides the adafruitio package.

Authentication for Adafruit IO is managed by providing your Adafruit IO username and token. The token is sent in the head of all web requests via the X-AIO-Key header. This is handled for you by the client library, which expects you API Token when it is initialized.

We recommend keeping the Token in an environment variable to avoid including it directly in your code.

client := adafruitio.NewClient(os.Getenv("ADAFRUIT_IO_USERNAME"), os.Getenv("ADAFRUIT_IO_KEY"))
feeds, _, err := adafruitio.Feed.All()

Some API calls expect parameters, which must be provided when making the call.

feed := &aio.Feed{Name: "my-new-feed"}
feed := client.Feed.Create(newFeed)

Data related API calls expect a Feed to be set before the call is made.

feed, _, ferr := client.Feed.Get("my-new-feed")
client.Data.Create(&adafruitio.Data{Value: 100})

More detailed example usage can be found in the ./examples directory

For full package documentation, visit the godoc page at


Copyright (c) 2016 Adafruit Industries. Licensed under the MIT license.


  • Fork it ( )
  • Create your feature branch (git checkout -b my-new-feature)
  • Commit your changes (git commit -am 'Add some feature')
  • Push to the branch (git push origin my-new-feature)
  • Create new Pull Request

adafruit invests time and resources providing this open source code. please support adafruit and open-source hardware by purchasing products from adafruit.