Get a berry
package main
import ( "fmt" "net/http" "io")
func main() {
url := "https://pokeapi.co/api/v2/berry/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/berry/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/berry/1/") .get() .build();
Response response = client.newCall(request).execute();import axios from 'axios';
const options = {method: 'GET', url: 'https://pokeapi.co/api/v2/berry/1/'};
try { const { data } = await axios.request(options); console.log(data);} catch (error) { console.error(error);}const url = 'https://pokeapi.co/api/v2/berry/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/berry/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/berry/1/wget --quiet \ --method GET \ --output-document \ - https://pokeapi.co/api/v2/berry/1/Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by Pokémon. Check out Bulbapedia for greater detail.
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.
Time it takes the tree to grow one stage, in hours. Berry trees go through four of these growth stages before they can be picked.
The maximum number of these berries that can grow on one tree in Generation IV.
The power of the move “Natural Gift” when used with this Berry.
The size of this Berry, in millimeters.
The smoothness of this Berry, used in making Pokéblocks or Poffins.
The speed at which this Berry dries out the soil as it grows. A higher rate means the soil dries more quickly.
A list of references to each flavor a berry can have and the potency of each of those flavors in regard to this berry.
object
How powerful the referenced flavor is for this berry.
The referenced berry flavor.
object
The name of the referenced resource.
The URL of the referenced resource.
Berries are actually items. This is a reference to the item specific data for this berry.
object
The name of the referenced resource.
The URL of the referenced resource.
Example
{ "id": 1, "name": "cheri", "growth_time": 3, "max_harvest": 5, "natural_gift_power": 60, "size": 20, "smoothness": 25, "soil_dryness": 15, "firmness": { "name": "soft", "url": "https://pokeapi.co/api/v2/berry-firmness/2/" }, "flavors": [ { "potency": 10, "flavor": { "name": "spicy", "url": "https://pokeapi.co/api/v2/berry-flavor/1/" } }, { "potency": 0, "flavor": { "name": "dry", "url": "https://pokeapi.co/api/v2/berry-flavor/2/" } } ], "item": { "name": "cheri-berry", "url": "https://pokeapi.co/api/v2/item/126/" }, "natural_gift_type": { "name": "fire", "url": "https://pokeapi.co/api/v2/type/10/" }}