PikaServe Wiki

PikaServe (pokemon-api) 2.0.0



This documentation is to help you use the front-end portal, as well as the query endpoint. Please go through the specefic sections carefully to avoid any error. You can always skip to sections from the navigation sidebar present on the left.

Quick tip: Use your browser's "find on page" feature to search for a specific resource ( Ctrl+F or Cmd+F )

This project was made for educational purposes. It was recently moved to a payed hosting in the favour of server over a secure connection(https) for modern broswers, which also means faster queries. Please consider supporting me by buying me a coffee if you would like to support development and hosting costs!



Notice

This is a consumption-only API — only.
No authentication is required to access this API, and all resources are open and available. The API is rate limited to 2500 calls as of now.

  • Locally cache resources whenever you request them
  • Report any bugs/flaws on the Github page as soon as you encounter them
  • Consider contributing to this open-source project

Front-End Portal#back to top

The front-end API module is under development, please watch this space for updates

API Quickstart#back to top

Get a random Pokemon!

Using the language / framework of your choice:

Try it or some other stuff below:

Confused? You can try pokemon/pikachu, pokemon/500, moves/aerialace, items/masterball, etc.

Getting the hang of it? Navigate using the navigation sidebar to specific endpoints to learn more about them!


GET Methods#back to top

/pokemon

/pokemon/all

Retrieves the complete pokemon database.
Request URL : https://api.pikaserve.xyz/pokemon/all

Output sample:

/pokemon/random

Retrives a random pokemon from the database.
Request URL : https://api.pikaserve.xyz/pokemon/random

Output sample:

/pokemon/{name}

Searches the database and retrives pokemon named {name}.
Request URL : https://api.pikaserve.xyz/pokemon/infernape

Output sample:

/pokemon/{pokedexID}

Searches the database and retrives pokemon numbered {pokedexID}.
Request URL : https://api.pikaserve.xyz/pokemon/696

Output sample:

/moves

/moves/all

Retrieves the complete moves database.
Request URL : https://api.pikaserve.xyz/moves/all

Output sample:

/moves/random

Retrives a random move from the database.
Request URL : https://api.pikaserve.xyz/moves/random

Output sample:

/moves/{name}

Searches the database and retrives move named {name}.
Request URL : https://api.pikaserve.xyz/moves/watershuriken

Output sample:

/moves/{movesID}

Searches the database and retrives move numbered {movesID}.
Request URL : https://api.pikaserve.xyz/pokemon/500

Output sample:

/items

/items/all

Retrieves the complete items database.
Request URL : https://api.pikaserve.xyz/items/all

Output sample:

/items/random

Retrives a random item from the database.
Request URL : https://api.pikaserve.xyz/items/random

Output sample:

/items/{name}

Searches the database and retrives item named {name}.
Request URL : https://api.pikaserve.xyz/items/bicycle

Output sample:

/items/{itemsID}

Searches the database and retrives item numbered {itemsID}.
Request URL : https://api.pikaserve.xyz/items/420

Output sample:

/types

/types/all

Retrieves the complete types database.
Request URL : https://api.pikaserve.xyz/types/all

Output sample:

/types/random

Retrives a random type from the database.
Request URL : https://api.pikaserve.xyz/types/random

Output sample:

/types/{name}

Searches the database and retrives type named {name}.
Request URL : https://api.pikaserve.xyz/types/fairy

Output sample:

/types/{typesID}

Searches the database and retrives type numbered {typesID}.
Request URL : https://api.pikaserve.xyz/types/15

Output sample:

Usage Examples#back to top

Node.js (JavaScript)

Using npm fetch

  • Install fetch using npm (or yarn)
  • npm i fetch
    or
    yarn add node-fetch
  • Create a file PikaServe.js
  • 
    const fetchUrl = require("fetch ").fetchUrl;
    
    const url = 'https://api.pikaserve.xyz/pokemon/random';
    
    fetchUrl(url, function(error, meta, body) {
        if (!error) {
            var data = new String();
            data = JSON.parse(body)
            // Do something with data
            console.log(data)
        }
    });
                                    
  • Run the file using the following code (in the terminal)
  • node PikaServe.js
  • You will see the following output in the terminal in this case
  • 
    // Sample Output
    {
        id: 799,
        name: {
            english: 'Guzzlord',
            japanese: 'アクジキング',
            chinese: '恶食大王',
            french: 'Necrozma'
        },
        type: [ 'Dark', 'Dragon' ],
        base: {
            HP: 223,
            Attack: 101,
            Defense: 53,
            'Sp. Attack': 97,
            'Sp. Defense': 53,
            Speed: 43
        }
    }
                                    

Python

  • Install requests using pip or any other package manager
  • pip install requests
  • Create a file PikaServe.py
  • 
    import requests
    import json         # For formatting the output
    
    response = requests.get("https://api.pikaserve.xyz/pokemon/random")
    
    # Do something with response data
    print(json.dumps(response.json(), sort_keys=True, indent=4))            #Or simply print(response.json())
                                    
  • Run the file in your IDE or by running the following code
  • python -u "{pathToFile}\PikaServe.py"
  • You will see the following output in this case
  • 
    {
        "base": {
            "Attack": 65,
            "Defense": 95,
            "HP": 40,
            "Sp. Attack": 60,
            "Sp. Defense": 45,
            "Speed": 35
        },
        "id": 109,
        "name": {
            "chinese": "\u74e6\u65af\u5f39",
            "english": "Koffing",
            "french": "Smogo",
            "japanese": "\u30c9\u30ac\u30fc\u30b9"
        },
        "type": [
            "Poison"
        ]
    }
                                    
    You can see a live example with this Google Colab notebook.

Change log #back to top


-----------------------------------------------------------------------------------------
Version 2.0.0 - Apr 6th, 2022
-----------------------------------------------------------------------------------------
- domain changed and updated
- project name changed (from pokemon-api to pikaserve)     
                                 

-----------------------------------------------------------------------------------------
Version 1.4.0 - Oct 24th, 2020
-----------------------------------------------------------------------------------------
    - /items structure changed
    - /items returns name in English, Japanese and Chinese


-----------------------------------------------------------------------------------------
Version 1.3.0 - Oct 24th, 2020
-----------------------------------------------------------------------------------------
    - Added image links (hires,thumbs,sprites) in /pokemon


                                    

Check the file versionHistory.md in the Github repository for the full version history

Copyright and license #back to top

Source code released under GNU GPLv3 License.

For more information about copyright and license check choosealicense.com.

Pokémon and Pokémon character names are trademarks of Nintendo and The Pokémon Company.