Skip to content
RESTful Pokemon API written in Go
Go
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Files

Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
pokemon.json @ 7b4af06
.gitignore
.gitmodules
LICENSE
README.md
common.go
error.go
go.mod
go.sum
items.go
json.go
main.go
moves.go
pokedex.go
search.go
types.go

README.md

RESTful Pokemon API written in Go

Pokemon Data is provided by Pokemon.json

Currently, the API has limited features. More features are currently in the working.

How to use

To run the server, run the following command in the root directory:

go build .

The default port is 8080, and can be configured.

Please note that two packages are required. To install the packages, run

go get -u github.com/gorilla/mux
go get -u github.com/sahilm/fuzzy

Example Request

GET localhost:8080/api/v1/item/1

Reponse:

{
   "id":1,
   "name":{
      "chinese":"大师球",
      "english":"Master Ball",
      "japanese":"マスターボール"
   }
}

Endpoints

The base API url is /api/v1.

To get Pokemon info: /pokemon/{Name|ID}

To get item info: /item/{Name|ID}

To get move info: /move/{Name|ID}

To get all types: /types

To search: /search/{Type}/{Query}

Types:

  • pokemon
  • item
  • move
  • type
You can’t perform that action at this time.