Get location area
GET
/api/v2/location-area/{id}/
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/location-area/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/location-area/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/location-area/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/location-area/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/location-area/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/location-area/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/location-area/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/location-area/1/Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible Pokémon encounters.
Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
integer
A unique integer value identifying this location area.
Responses
Section titled “Responses”Media typeapplication/json
object
id
required
integer
name
required
string
game_index
required
integer
encounter_method_rates
required
Array<object>
object
encounter_method
required
object
name
required
string
url
required
string format: uri
version_details
required
Array<object>
object
rate
required
integer format: int32
version
required
object
name
required
string
url
required
string format: uri
location
required
object
name
required
string
url
required
string format: uri
names
required
Array<object>
object
name
required
string
language
required
object
name
required
string
url
required
string format: uri
pokemon_encounters
required
Array<object>
object
pokemon
required
object
name
required
string
url
required
string format: uri
version_details
required
Array<object>
object
version
required
object
name
required
string
url
required
string format: uri
max_chance
required
integer format: int32
encounter_details
required
object
min_level
required
integer format: int32
max_level
required
integer format: int32
condition_values
object
name
required
string
url
required
string format: uri
chance
required
integer format: int32
method
required
object
name
required
string
url
required
string format: uri
Example
{ "encounter_method_rates": [ { "encounter_method": { "name": "old-rod", "url": "https://pokeapi.co/api/v2/encounter-method/2/" }, "version_details": [ { "rate": 5, "version": { "name": "platinum", "url": "https://pokeapi.co/api/v2/version/14/" } } ] } ], "pokemon_encounters": [ { "pokemon": { "name": "tentacool", "url": "https://pokeapi.co/api/v2/pokemon/72/" }, "version_details": [ { "version": { "name": "diamond", "url": "https://pokeapi.co/api/v2/version/12/" }, "max_chance": 60, "encounter_details": { "min_level": 20, "max_level": 30, "condition_values": { "name": "slot2-sapphire", "url": "https://pokeapi.co/api/v2/encounter-condition-value/10/" }, "chance": 60, "method": { "name": "surf", "url": "https://pokeapi.co/api/v2/encounter-method/5/" } } } ] } ]}