github.com/pokeintel/pogo

Unofficial PokemonGO API in Go


Keywords
pgoapi
License
MIT
Install
go get github.com/pokeintel/pogo

Documentation

pogo

Pokémon Go API tools written in Golang

Library

You can include this package as a library in your own project.

Example

import (
  "fmt"
  "github.com/zeeraw/pogo/api"
  "github.com/zeeraw/pogo/auth"
)

func main() {

  // Initialize a new authentication provider to retrieve an access token
  provider, err := auth.NewProvider("ptc", "MyUser", "Pass1!!)")
  if err != nil {
    fmt.Println(err)
    return
  }

  // Set the coordinates from where you're connecting
  location := &api.Location{
    Lon: 0.0,
    Lat: 0.0,
    Alt: 0.0,
  }

  // Start new session and connect
  session := api.NewSession(provider, location, false)
  session.Init()

  // Start querying the API
  player, err := client.GetPlayer()
  if err != nil {
    fmt.Println(err)
    return
  }

  out, err := json.Marshal(player)
  if err != nil {
    fmt.Println(err)
    return
  }

  fmt.Println(string(out))
  return nil

}

Command line tool

Install

Make sure you're running the latest version of Go, then simply install through go get.

$ go get -u github.com/zeeraw/pogo

Usage

Get player profile

$ pogo -u <username> -p <Secret1234> --lat 0.0 --lon 0.0 player

Configure through environment variables

export POGO_ACCOUNT_USERNAME=MyUserAccount
export POGO_ACCOUNT_USERNAME=PasswordThatIsSecret
$ pogo --lat 0.0 --lon 0.0 player

Credit