0.1.5 • Published 8 years ago

pokespotter v0.1.5

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Pokespotter - Node.js library for finding Pokemon in Pokemon GO

This module allows you to easily determine the Pokemon that are around a certain location. It uses the Node.js wrapper for the Pokemon GO API.

Installation

1. Install Node Module

npm install pokespotter --save

2. Get Credentials

You need either a Google account or Pokemon Trainer Club account. Best save these as environment variables:

VariablePurpose
PGO_USERNAMEYour Pokemon GO / Google username
PGO_PASSWORDYour Pokemon GO / Google password
PGO_PROVIDER'ptc' for Pokemon Trainer Club or 'google' for Google

3. Require and initialize module

var Pokespotter = require('pokespotter')(); // add username, password, provider if necessary

Example using Google

var Pokespotter = require('pokespotter')('username@gmail.com', 'mypassword', 'google');

Pokespotter.get('Central Park, New York').then(function (pokemon) {
  console.log(pokemon);
});

API Documentation

Pokespotter(username, password, provider) ⇒ Pokespotter

Initializer for Pokespotter. Credentials can be passed as arguments or stored in the ENV variables: PGO_USERNAME, PGO_PASSWORD, PGO_PROVIDER

ParamTypeDescription
PGO_USERNAMEstringYour Pokemon GO / Google username
PGO_PASSWORDstringYour Pokemon GO / Google password
PGO_PROVIDERstring'ptc' for Pokemon Trainer Club or 'google' for Google

Pokespotter methods

get(location, options)Promise<Pokemon[]>

Gets all the Pokemon around a certain location. The location can be latitude, longitude or an address that will be checked with Open Street Map.

ParamTypeDescription
locationstringLocationActual location (lat/long) or an address to look up
optionsGetOptionsOptions to alter call behavior

getNearby(location, options)Promise<Pokemon[]>

Alias for get(location, options)

Pokedex

Array of all Pokemon with their Pokedex number as index.

getMapsUrl() ⇒ string

ParamTypeDescription
centerstring or LocationCentral location of the map
pokemonPokemon[]List of Pokemon to mark on the map
stepsnumberThe amount of steps used to search
sizestringSize of the map. Default 512x512

Types

Location

FieldTypeDescription
longitudenumberLocation longitude
latitudenumberLocation latitude

GetOptions

FieldTypeDescription
stepsnumberNumber of steps the API should explore in each direction from the base
requestDelaynumberTimeout in milliseconds before each API call. Needed for more steps.

Pokemon

FieldTypeDescription
spawnPointIdstringInternal ID for the place a Pokemon spawned
longitudenumberLongitude of the current location of a Pokemon
latitudenumberLatitude of the current location of a Pokemon
expirationTimenumberUNIX timestamp in milliseconds when a Pokemon disappears
pokemonIdnumberOfficial Pokedex Number
namestringEnglish name of Pokemon
distancenumberDistance in meters to the requested location

Shoutouts and Thanks

  • Python API work by tejado
  • Node library we based our work on by Armax
  • Pokemon Go Map code we learned from by AHAAAAAAA

Disclaimer

The used API wrapper uses an unofficial Niantic API. They might block you for using this. Therefore it is not recommended to use this or any other API with your actual account.

Contributors

  • Dominik Kundel
  • Brent Schooley