Skip to content

Get machine

GET
/api/v2/machine/{id}/
const url = 'https://pokeapi.co/api/v2/machine/1/';
const options = {method: 'GET'};
try {
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
} catch (error) {
console.error(error);
}

Machines are the representation of items that teach moves to Pokémon. They vary from version to version, so it is not certain that one specific TM or HM corresponds to a single Machine.

id
required
string

This parameter can be a string or an integer.

Examples

Example1
Terminal window
1
Media typeapplication/json
object
id
required

The identifier for this resource.

integer
item
required

The TM or HM item that corresponds to this machine.

object
name
required

The name of the referenced resource.

string
<= 200 characters
url
required

The URL of the referenced resource.

string format: uri
version_group
required

The version group that this machine applies to.

object
name
required

The name of the referenced resource.

string
<= 200 characters
url
required

The URL of the referenced resource.

string format: uri
move
required

The move that is taught by this machine.

object
name
required

The name of the referenced resource.

string
<= 200 characters
url
required

The URL of the referenced resource.

string format: uri

Example

Terminal window
{
"id": 1,
"item": {
"name": "tm00",
"url": "https://pokeapi.co/api/v2/item/1288/"
},
"version_group": {
"name": "sword-shield",
"url": "https://pokeapi.co/api/v2/version-group/20/"
},
"move": {
"name": "mega-punch",
"url": "https://pokeapi.co/api/v2/move/5/"
}
}