Get item
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/item/1/"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close() body, _ := io.ReadAll(res.Body)
fmt.Println(res) fmt.Println(string(body))
}HttpRequest request = HttpRequest.newBuilder() .uri(URI.create("https://pokeapi.co/api/v2/item/1/")) .method("GET", HttpRequest.BodyPublishers.noBody()) .build();HttpResponse<String> response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());System.out.println(response.body());OkHttpClient client = new OkHttpClient();
Request request = new Request.Builder() .url("https://pokeapi.co/api/v2/item/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/item/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/item/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);}use reqwest;
#[tokio::main]pub async fn main() { let url = "https://pokeapi.co/api/v2/item/1/";
let client = reqwest::Client::new(); let response = client.get(url) .send() .await;
let results = response.unwrap() .json::<serde_json::Value>() .await .unwrap();
dbg!(results);}curl --request GET \ --url https://pokeapi.co/api/v2/item/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/item/1/An item is an object in the games which the player can pick up, keep in their bag, and use in some manner. They have various uses, including healing, powering up, helping catch Pokémon, or to access a new area.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”This parameter can be a string or an integer.
Examples
1Responses
Section titled “Responses”object
The identifier for this resource.
The name for this resource.
The power of the move Fling when used with this item.
A list of attributes this item has.
object
The name of the referenced resource.
The URL of the referenced resource.
The category of items this item falls into.
object
The name of the referenced resource.
The URL of the referenced resource.
The effect of this ability listed in different languages.
object
The localized effect text for an API resource in a specific language.
The localized effect text in brief.
The language this effect is in.
object
The name of the referenced resource.
The URL of the referenced resource.
The flavor text of this ability listed in different languages.
object
The localized flavor text for an API resource in a specific language.
The version group which uses this flavor text.
object
The name of the referenced resource.
The URL of the referenced resource.
The language this name is in.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of game indices relevent to this item by generation.
object
The internal id of an API resource within game data.
The generation relevent to this game index.
object
The name of the referenced resource.
The URL of the referenced resource.
Purchase and sell prices by currency and version group. Prices may be null when the item cannot be bought or sold.
object
The purchase price in this currency and version group, or null if unavailable.
The sell price in this currency and version group, or null if unavailable.
The currency used for this price.
object
The name of the referenced resource.
The URL of the referenced resource.
The version group to which this price applies.
object
The name of the referenced resource.
The URL of the referenced resource.
The name of this item listed in different languages.
object
The localized name for an API resource in a specific language.
The language this name is in.
object
The name of the referenced resource.
The URL of the referenced resource.
A list of Pokémon that might be found in the wild holding this item.
object
The Pokémon that holds this item.
object
The name of the referenced resource.
The URL of the referenced resource.
The details for the version that this item is held in by the Pokémon.
object
How often the item is held.
The version in which the item is held.
object
The name of the referenced resource.
The URL of the referenced resource.
A set of sprites used to depict this item in the game.
object
The default depiction of this item.
A list of the machines related to this item.
object
The machine that teaches a move from an item.
object
The URL of the referenced resource.
The version group of this specific machine.
object
The name of the referenced resource.
The URL of the referenced resource.
Example
{ "id": 1, "name": "master-ball", "fling_power": null, "fling_effect": null, "attributes": [ { "name": "countable", "url": "https://pokeapi.co/api/v2/item-attribute/1/" }, { "name": "consumable", "url": "https://pokeapi.co/api/v2/item-attribute/2/" } ], "category": { "name": "standard-balls", "url": "https://pokeapi.co/api/v2/item-category/34/" }, "effect_entries": [ { "effect": "Used in battle\n: Catches a wild Pokémon without fail.\n\n If used in a trainer battle, nothing happens and the ball is lost.", "short_effect": "Catches a wild Pokémon every time.", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ], "flavor_text_entries": [ { "text": "The best BALL that\ncatches a POKéMON\nwithout fail.", "version_group": { "name": "ruby-sapphire", "url": "https://pokeapi.co/api/v2/version-group/5/" }, "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } }, { "text": "The best BALL that\ncatches a POKéMON\nwithout fail.", "version_group": { "name": "emerald", "url": "https://pokeapi.co/api/v2/version-group/6/" }, "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ], "game_indices": [ { "game_index": 1, "generation": { "name": "generation-i", "url": "https://pokeapi.co/api/v2/generation/1/" } }, { "game_index": 1, "generation": { "name": "generation-ii", "url": "https://pokeapi.co/api/v2/generation/2/" } } ], "prices": [ { "purchase_price": null, "sell_price": 0, "currency": { "name": "poke-dollar", "url": "https://pokeapi.co/api/v2/currency/1/" }, "version_group": { "name": "red-blue", "url": "https://pokeapi.co/api/v2/version-group/1/" } }, { "purchase_price": null, "sell_price": 0, "currency": { "name": "poke-dollar", "url": "https://pokeapi.co/api/v2/currency/1/" }, "version_group": { "name": "yellow", "url": "https://pokeapi.co/api/v2/version-group/2/" } } ], "names": [ { "name": "Master Ball", "language": { "name": "en", "url": "https://pokeapi.co/api/v2/language/9/" } } ], "held_by_pokemon": [], "sprites": { "default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/items/master-ball.png" }, "baby_trigger_for": null, "machines": []}