List pokedex
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/pokedex/"
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/pokedex/")) .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/pokedex/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/pokedex/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/pokedex/';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/pokedex/";
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/pokedex/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/pokedex/A Pokédex is a handheld electronic encyclopedia device; one which is capable of recording and retaining information of the various Pokémon in a given region with the exception of the national dex and some smaller dexes related to portions of a region. See Bulbapedia for greater detail.
Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”Number of results to return per page.
The initial index from which to return the results.
Only available locally and not at pokeapi.co Case-insensitive query applied on the
nameproperty.
Responses
Section titled “Responses”object
The total number of resources available from this API.
The URL for the next page in the list, or null if there is no next page.
The URL for the previous page in the list, or null if there is no previous page.
A list of API resources on this page.
object
The name of the referenced resource.
The URL of the referenced resource.
Example
{ "count": 35, "next": "https://pokeapi.co/api/v2/pokedex/?offset=2&limit=2", "previous": null, "results": [ { "name": "national", "url": "https://pokeapi.co/api/v2/pokedex/1/" }, { "name": "kanto", "url": "https://pokeapi.co/api/v2/pokedex/2/" } ]}