diff --git a/.circleci/config.yml b/.circleci/config.yml index ca9a35331..4c6522940 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -20,6 +20,9 @@ jobs: - run: name: Run tests command: make test + - run: + name: Generate OpenAPI schema + command: make openapi-generate build: docker: - image: cimg/python:3.10.9 diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml index cfdf18885..4c7b0655a 100644 --- a/.github/workflows/docker-build.yml +++ b/.github/workflows/docker-build.yml @@ -35,7 +35,7 @@ jobs: context: . file: ./Resources/docker/app/Dockerfile push: false - platforms: local + platforms: local,linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 66d81883d..2ab7c1566 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -13,24 +13,24 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@v4 with: submodules: recursive - name: Docker meta id: meta - uses: docker/metadata-action@v3 + uses: docker/metadata-action@v5 with: # list of Docker images to use as base name for tags images: | pokeapi/pokeapi - name: Set up QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx id: buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@v3 - name: Login to DockerHub if: github.event_name != 'pull_request' - uses: docker/login-action@v1 + uses: docker/login-action@v1 with: username: ${{ secrets.DOCKERHUB_USERNAME_NARAMSIM }} password: ${{ secrets.DOCKERHUB_TOKEN_NARAMSIM }} @@ -43,12 +43,12 @@ jobs: echo "Platforms: ${{ steps.buildx.outputs.platforms }}" - name: Build and push id: docker_build - uses: docker/build-push-action@v2 + uses: docker/build-push-action@v5 with: context: . file: ./Resources/docker/app/Dockerfile push: true - platforms: linux/amd64,linux/arm64,linux/ppc64le,linux/arm/v7,linux/arm/v6 + platforms: linux/amd64,linux/arm64,linux/arm/v7,linux/arm/v6 tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - name: Image digest diff --git a/Makefile b/Makefile index 3760771a3..c54b9ef5d 100755 --- a/Makefile +++ b/Makefile @@ -41,6 +41,9 @@ make-migrations: # Create migrations files if schema has changed shell: # Load a shell python manage.py shell ${local_config} +openapi-generate: + python manage.py spectacular --color --file openapi.yml ${local_config} + docker-up: # (Docker) Create services/volumes/networks docker compose up -d @@ -140,10 +143,10 @@ update-graphql-data-prod: git submodule update --init docker compose stop graphql-engine sync; echo 3 > /proc/sys/vm/drop_caches - docker compose -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d app + docker compose -f docker-compose.yml -f Resources/compose/docker-compose-prod-graphql.yml up -d app cache make docker-migrate make docker-build-db - docker compose stop app + docker compose stop app cache sync; echo 3 > /proc/sys/vm/drop_caches docker compose exec -T web sh -c 'rm -rf /tmp/cache/*' docker compose start graphql-engine diff --git a/Resources/compose/docker-compose-prod-graphql.yml b/Resources/compose/docker-compose-prod-graphql.yml index 9e8682285..d149ecbf3 100644 --- a/Resources/compose/docker-compose-prod-graphql.yml +++ b/Resources/compose/docker-compose-prod-graphql.yml @@ -1,5 +1,8 @@ version: '2.4' services: + cache: + restart: "no" + db: environment: POSTGRES_PASSWORD: "${POSTGRES_PASSWORD}" diff --git a/Resources/docker/app/Dockerfile b/Resources/docker/app/Dockerfile index c2d729404..a8d2ac4da 100644 --- a/Resources/docker/app/Dockerfile +++ b/Resources/docker/app/Dockerfile @@ -7,9 +7,9 @@ RUN mkdir /code WORKDIR /code ADD requirements.txt /code/ -RUN \ - apk add --no-cache postgresql-libs libstdc++ && \ - apk add --no-cache --virtual .build-deps gcc g++ musl-dev postgresql-dev && \ +RUN apk add --no-cache postgresql-libs libstdc++ +RUN apk add --no-cache --virtual .build-deps gcc g++ musl-dev \ + postgresql-dev rust cargo && \ python3 -m pip install -r requirements.txt --no-cache-dir && \ apk --purge del .build-deps ADD . /code/ diff --git a/config/settings.py b/config/settings.py index 8213dd2e0..5459cc7db 100755 --- a/config/settings.py +++ b/config/settings.py @@ -99,6 +99,7 @@ "corsheaders", "rest_framework", "cachalot", + "drf_spectacular", ) + CUSTOM_APPS @@ -116,6 +117,7 @@ "DEFAULT_PAGINATION_CLASS": "rest_framework.pagination.LimitOffsetPagination", "PAGE_SIZE": 20, "PAGINATE_BY": 20, + "DEFAULT_SCHEMA_CLASS": "drf_spectacular.openapi.AutoSchema", } @@ -136,3 +138,42 @@ ] DEFAULT_AUTO_FIELD = "django.db.models.AutoField" + +SPECTACULAR_SETTINGS = { + "TITLE": "PokéAPI", + "DESCRIPTION": """All the Pokémon data you'll ever need in one place, easily accessible through a modern free open-source RESTful API. + +## What is this? + +This is a full RESTful API linked to an extensive database detailing everything about the Pokémon main game series. + +We've covered everything from Pokémon to Berry Flavors. + +## Where do I start? + +We have awesome [documentation](https://pokeapi.co/docs/v2) on how to use this API. It takes minutes to get started. + +This API will always be publicly available and will never require any extensive setup process to consume. + +Created by [**Paul Hallett**(]https://github.com/phalt) and other [**PokéAPI contributors***](https://github.com/PokeAPI/pokeapi#contributing) around the world. Pokémon and Pokémon character names are trademarks of Nintendo. + """, + "SERVERS": [{"url": "https://pokeapi.co"}], + "EXTERNAL_DOCS": {"url": "https://pokeapi.co/docs/v2"}, + "VERSION": "2.7.0", + "SERVE_INCLUDE_SCHEMA": False, + "OAS_VERSION": "3.1.0", + "COMPONENT_SPLIT_REQUEST": True, + "TAGS": [ + "pokemon", + "evolution", + "berries", + "items", + "machines", + "location", + "contest", + "moves", + "encounters", + "games", + "utility", + ], +} diff --git a/config/wsgi.py b/config/wsgi.py index 9642109ba..d246049de 100755 --- a/config/wsgi.py +++ b/config/wsgi.py @@ -13,6 +13,7 @@ framework. """ + import os from django.core.wsgi import get_wsgi_application diff --git a/data/v2/build.py b/data/v2/build.py index 4c3eae767..9e6459eb7 100644 --- a/data/v2/build.py +++ b/data/v2/build.py @@ -1242,9 +1242,11 @@ def csv_record_to_objects(info): id=int(info[0]), location_id=int(info[1]), game_index=int(info[2]), - name="{}-{}".format(location.name, info[3]) - if info[3] - else "{}-{}".format(location.name, "area"), + name=( + "{}-{}".format(location.name, info[3]) + if info[3] + else "{}-{}".format(location.name, "area") + ), ) build_generic((LocationArea,), "location_areas.csv", csv_record_to_objects) diff --git a/data/v2/csv/evolution_trigger_prose.csv b/data/v2/csv/evolution_trigger_prose.csv index 85c0123cd..adf56fad3 100644 --- a/data/v2/csv/evolution_trigger_prose.csv +++ b/data/v2/csv/evolution_trigger_prose.csv @@ -3,8 +3,8 @@ evolution_trigger_id,local_language_id,name 1,6,Levelaufstieg 1,9,Level up 2,5,Échange -2,6,Tausch -2,9,Trade +2,6,Tausch oder Verbindungsschnur +2,9,Trade or Linking Cord 3,5,Utilisation d'un objet 3,6,Gegenstand nutzen 3,9,Use item diff --git a/data/v2/csv/item_flag_map.csv b/data/v2/csv/item_flag_map.csv index 842ccfcb1..b7a11b45a 100644 --- a/data/v2/csv/item_flag_map.csv +++ b/data/v2/csv/item_flag_map.csv @@ -610,3 +610,7 @@ item_id,item_flag_id 303,7 304,5 304,7 +2160,1 +2160,2 +2160,3 +2160,5 \ No newline at end of file diff --git a/data/v2/csv/item_names.csv b/data/v2/csv/item_names.csv index b9327daf3..ba895daaf 100644 --- a/data/v2/csv/item_names.csv +++ b/data/v2/csv/item_names.csv @@ -17822,3 +17822,5 @@ item_id,local_language_id,name 2159,1,チャデスのこな 2159,9,Poltchageist Powder 2159,11,チャデスのこな +2160,9,Linking Cord +2160,11, つながりのヒモ \ No newline at end of file diff --git a/data/v2/csv/item_prose.csv b/data/v2/csv/item_prose.csv index f636302a0..6dfe32c60 100644 --- a/data/v2/csv/item_prose.csv +++ b/data/v2/csv/item_prose.csv @@ -1519,3 +1519,4 @@ This item can only be obtained or used via the Wonder Launcher." 1003,9,XXX new effect for roto-pp-restore,XXX new effect for roto-pp-restore 1004,9,XXX new effect for roto-boost,XXX new effect for roto-boost 1005,9,XXX new effect for roto-catch,XXX new effect for roto-catch +2160,9,Allows a Pokemon whose evolution is usually triggered by trading to evolve, The Linking Cord triggers the evolution of certain Pokémon (all of which can alternatively evolve when traded) upon use. This consumes the Linking Cord. diff --git a/data/v2/csv/items.csv b/data/v2/csv/items.csv index f90a3799d..cac23fbd2 100644 --- a/data/v2/csv/items.csv +++ b/data/v2/csv/items.csv @@ -2107,5 +2107,6 @@ id,identifier,category_id,cost,fling_power,fling_effect_id 2157,cramorant-down,54,30,, 2158,morpeko-snack,54,15,, 2159,poltchageist-powder,54,30,, +2160,linking-cord,10,8000,, 10001,black-augurite,10,0,, 10002,peat-block,10,0,, diff --git a/data/v2/csv/moves.csv b/data/v2/csv/moves.csv index 3ac69894e..fb2f0a96a 100644 --- a/data/v2/csv/moves.csv +++ b/data/v2/csv/moves.csv @@ -719,12 +719,12 @@ id,identifier,generation_id,type_id,power,pp,accuracy,priority,target_id,damage_ 718,multi-attack,7,1,120,10,100,0,10,2,269,,,, 719,10-000-000-volt-thunderbolt,7,13,195,1,,0,10,3,1,,,, 720,mind-blown,7,10,150,5,100,0,9,3,420,,,, -721,plasma-fists,7,13,100,15,100,0,10,2,1,,,, +721,plasma-fists,7,13,100,15,100,0,10,2,417,,,, 722,photon-geyser,7,14,100,5,100,0,10,3,1,,,, 723,light-that-burns-the-sky,7,14,200,1,,0,10,3,416,,,, 724,searing-sunraze-smash,7,9,200,1,,0,10,2,411,,,, 725,menacing-moonraze-maelstrom,7,8,200,1,,0,10,3,411,,,, -726,lets-snuggle-forever,7,18,190,1,,0,10,2,417,,,, +726,lets-snuggle-forever,7,18,190,1,,0,10,2,1,,,, 727,splintered-stormshards,7,6,190,1,,0,10,2,418,,,, 728,clangorous-soulblaze,7,16,185,1,,0,11,3,419,100,,, 729,zippy-zap,7,13,80,10,100,2,10,2,1,100,,, diff --git a/data/v2/csv/pokemon.csv b/data/v2/csv/pokemon.csv index 46f3675be..2b40b300e 100644 --- a/data/v2/csv/pokemon.csv +++ b/data/v2/csv/pokemon.csv @@ -897,133 +897,133 @@ id,identifier,species_id,height,weight,base_experience,order,is_default 896,glastrier,896,22,8000,290,1088,1 897,spectrier,897,20,445,290,1089,1 898,calyrex,898,11,77,250,1090,1 -899,wyrdeer,899,18,951,,,1 -900,kleavor,900,18,890,,,1 -901,ursaluna,901,24,2900,,,1 -902,basculegion-male,902,30,1100,,,1 -903,sneasler,903,13,430,,,1 -904,overqwil,904,25,605,,,1 -905,enamorus-incarnate,905,16,480,,,1 -906,sprigatito,906,4,41,,906,1 -907,floragato,907,9,122,,907,1 -908,meowscarada,908,15,312,,908,1 -909,fuecoco,909,4,98,,909,1 -910,crocalor,910,10,307,,910,1 -911,skeledirge,911,16,3265,,911,1 -912,quaxly,912,5,61,,912,1 -913,quaxwell,913,12,215,,913,1 -914,quaquaval,914,18,619,,914,1 -915,lechonk,915,5,102,,915,1 -916,oinkologne,916,10,1200,,916,1 -917,tarountula,917,3,40,,918,1 -918,spidops,918,10,165,,919,1 -919,nymble,919,2,10,,920,1 -920,lokix,920,10,175,,921,1 -921,pawmi,921,3,25,,954,1 -922,pawmo,922,4,65,,955,1 -923,pawmot,923,9,410,,956,1 -924,tandemaus,924,3,18,,945,1 -925,maushold,925,3,23,,946,1 -926,fidough,926,3,109,,970,1 -927,dachsbun,927,5,149,,971,1 -928,smoliv,928,3,65,,935,1 -929,dolliv,929,6,119,,936,1 -930,arboliva,930,14,482,,937,1 -931,squawkabilly,931,6,24,,960,1 -932,nacli,932,4,160,,963,1 -933,naclstack,933,6,1050,,964,1 -934,garganacl,934,23,2400,,965,1 -935,charcadet,935,6,105,,1003,1 -936,armarouge,936,15,850,,1004,1 -937,ceruledge,937,16,620,,1005,1 -938,tadbulb,938,3,4,,940,1 -939,bellibolt,939,12,1130,,941,1 -940,wattrel,940,4,36,,957,1 -941,kilowattrel,941,14,386,,958,1 -942,maschiff,942,5,160,,972,1 -943,mabosstiff,943,11,610,,973,1 -944,shroodle,944,2,7,,968,1 -945,grafaiai,945,7,272,,969,1 -946,bramblin,946,6,6,,974,1 -947,brambleghast,947,12,60,,975,1 -948,toedscool,948,9,330,,1006,1 -949,toedscruel,949,19,580,,1007,1 -950,klawf,950,13,790,,962,1 -951,capsakid,951,3,30,,938,1 -952,scovillain,952,9,150,,939,1 -953,rellor,953,2,10,,922,1 -954,rabsca,954,3,35,,923,1 -955,flittle,955,2,15,,926,1 -956,espathra,956,19,900,,927,1 -957,tinkatink,957,4,89,,1000,1 -958,tinkatuff,958,7,591,,1001,1 -959,tinkaton,959,7,1128,,1002,1 -960,wiglett,960,12,18,,929,1 -961,wugtrio,961,12,54,,930,1 -962,bombirdier,962,15,429,,959,1 -963,finizen,963,13,602,,933,1 -964,palafin,964,13,602,,934,1 -965,varoom,965,10,350,,942,1 -966,revavroom,966,18,1200,,943,1 -967,cyclizar,967,16,630,,953,1 -968,orthworm,968,25,3100,,944,1 -969,glimmet,969,7,80,,966,1 -970,glimmora,970,15,450,,967,1 -971,greavard,971,6,350,,924,1 -972,houndstone,972,20,150,,925,1 -973,flamigo,973,16,370,,961,1 -974,cetoddle,974,12,450,,947,1 -975,cetitan,975,45,7000,,948,1 -976,veluza,976,25,900,,932,1 -977,dondozo,977,120,2200,,931,1 -978,tatsugiri,978,3,80,,952,1 -979,annihilape,979,12,560,,1010,1 -980,clodsire,980,18,2230,,1009,1 -981,farigiraf,981,32,1600,,928,1 -982,dudunsparce,982,36,392,,917,1 -983,kingambit,983,20,1200,,1008,1 -984,great-tusk,984,22,3200,,978,1 -985,scream-tail,985,12,80,,982,1 -986,brute-bonnet,986,12,210,,979,1 -987,flutter-mane,987,14,40,,983,1 -988,slither-wing,988,32,920,,984,1 -989,sandy-shocks,989,23,600,,981,1 -990,iron-treads,990,9,2400,,986,1 -991,iron-bundle,991,6,110,,992,1 -992,iron-hands,992,18,3807,,989,1 -993,iron-jugulis,993,13,1110,,990,1 -994,iron-moth,994,12,360,,988,1 -995,iron-thorns,995,16,3030,,991,1 -996,frigibax,996,5,170,,949,1 -997,arctibax,997,8,300,,950,1 -998,baxcalibur,998,21,2100,,951,1 -999,gimmighoul,999,3,50,,976,1 -1000,gholdengo,1000,12,300,,977,1 -1001,wo-chien,1001,15,742,,996,1 -1002,chien-pao,1002,19,1522,,995,1 -1003,ting-lu,1003,27,6997,,994,1 -1004,chi-yu,1004,4,49,,997,1 -1005,roaring-moon,1005,20,3800,,985,1 -1006,iron-valiant,1006,14,350,,993,1 -1007,koraidon,1007,25,3030,,998,1 -1008,miraidon,1008,35,2400,,999,1 -1009,walking-wake,1009,35,2800,,1093,1 -1010,iron-leaves,1010,15,1250,,1094,1 -1011,dipplin,1011,4,97,,1095,1 -1012,poltchageist,1012,1,11,,1096,1 -1013,sinistcha,1013,2,22,,1097,1 -1014,okidogi,1014,18,922,,1098,1 -1015,munkidori,1015,10,122,,1099,1 -1016,fezandipiti,1016,14,301,,1100,1 -1017,ogerpon,1017,12,398,,1101,1 -1018,archaludon,1018,20,600,,1102,1 -1019,hydrapple,1019,18,930,,1103,1 -1020,gouging-fire,1020,35,5900,,1104,1 -1021,raging-bolt,1021,52,4800,,1105,1 -1022,iron-boulder,1022,15,1625,,1106,1 -1023,iron-crown,1023,16,1560,,1107,1 -1024,terapagos,1024,2,65,,1108,1 -1025,pecharunt,1025,3,3,,1109,1 +899,wyrdeer,899,18,951,263,,1 +900,kleavor,900,18,890,175,,1 +901,ursaluna,901,24,2900,275,,1 +902,basculegion-male,902,30,1100,265,,1 +903,sneasler,903,13,430,102,,1 +904,overqwil,904,25,605,179,,1 +905,enamorus-incarnate,905,16,480,116,,1 +906,sprigatito,906,4,41,62,906,1 +907,floragato,907,9,122,144,907,1 +908,meowscarada,908,15,312,265,908,1 +909,fuecoco,909,4,98,62,909,1 +910,crocalor,910,10,307,144,910,1 +911,skeledirge,911,16,3265,265,911,1 +912,quaxly,912,5,61,62,912,1 +913,quaxwell,913,12,215,144,913,1 +914,quaquaval,914,18,619,265,914,1 +915,lechonk,915,5,102,51,915,1 +916,oinkologne,916,10,1200,171,916,1 +917,tarountula,917,3,40,42,918,1 +918,spidops,918,10,165,141,919,1 +919,nymble,919,2,10,42,920,1 +920,lokix,920,10,175,158,921,1 +921,pawmi,921,3,25,48,954,1 +922,pawmo,922,4,65,123,955,1 +923,pawmot,923,9,410,245,956,1 +924,tandemaus,924,3,18,61,945,1 +925,maushold,925,3,23,165,946,1 +926,fidough,926,3,109,62,970,1 +927,dachsbun,927,5,149,167,971,1 +928,smoliv,928,3,65,52,935,1 +929,dolliv,929,6,119,124,936,1 +930,arboliva,930,14,482,255,937,1 +931,squawkabilly,931,6,24,146,960,1 +932,nacli,932,4,160,56,963,1 +933,naclstack,933,6,1050,124,964,1 +934,garganacl,934,23,2400,250,965,1 +935,charcadet,935,6,105,51,1003,1 +936,armarouge,936,15,850,263,1004,1 +937,ceruledge,937,16,620,263,1005,1 +938,tadbulb,938,3,4,54,940,1 +939,bellibolt,939,12,1130,173,941,1 +940,wattrel,940,4,36,56,957,1 +941,kilowattrel,941,14,386,172,958,1 +942,maschiff,942,5,160,68,972,1 +943,mabosstiff,943,11,610,177,973,1 +944,shroodle,944,2,7,58,968,1 +945,grafaiai,945,7,272,170,969,1 +946,bramblin,946,6,6,55,974,1 +947,brambleghast,947,12,60,168,975,1 +948,toedscool,948,9,330,67,1006,1 +949,toedscruel,949,19,580,180,1007,1 +950,klawf,950,13,790,158,962,1 +951,capsakid,951,3,30,61,938,1 +952,scovillain,952,9,150,170,939,1 +953,rellor,953,2,10,54,922,1 +954,rabsca,954,3,35,165,923,1 +955,flittle,955,2,15,51,926,1 +956,espathra,956,19,900,168,927,1 +957,tinkatink,957,4,89,59,1000,1 +958,tinkatuff,958,7,591,133,1001,1 +959,tinkaton,959,7,1128,253,1002,1 +960,wiglett,960,12,18,49,929,1 +961,wugtrio,961,12,54,149,930,1 +962,bombirdier,962,15,429,243,959,1 +963,finizen,963,13,602,63,933,1 +964,palafin,964,13,602,160,934,1 +965,varoom,965,10,350,60,942,1 +966,revavroom,966,18,1200,175,943,1 +967,cyclizar,967,16,630,175,953,1 +968,orthworm,968,25,3100,240,944,1 +969,glimmet,969,7,80,70,966,1 +970,glimmora,970,15,450,184,967,1 +971,greavard,971,6,350,58,924,1 +972,houndstone,972,20,150,171,925,1 +973,flamigo,973,16,370,175,961,1 +974,cetoddle,974,12,450,67,947,1 +975,cetitan,975,45,7000,182,948,1 +976,veluza,976,25,900,167,932,1 +977,dondozo,977,120,2200,265,931,1 +978,tatsugiri,978,3,80,166,952,1 +979,annihilape,979,12,560,268,1010,1 +980,clodsire,980,18,2230,151,1009,1 +981,farigiraf,981,32,1600,260,928,1 +982,dudunsparce,982,36,392,182,917,1 +983,kingambit,983,20,1200,275,1008,1 +984,great-tusk,984,22,3200,285,978,1 +985,scream-tail,985,12,80,285,982,1 +986,brute-bonnet,986,12,210,285,979,1 +987,flutter-mane,987,14,40,285,983,1 +988,slither-wing,988,32,920,285,984,1 +989,sandy-shocks,989,23,600,285,981,1 +990,iron-treads,990,9,2400,285,986,1 +991,iron-bundle,991,6,110,285,992,1 +992,iron-hands,992,18,3807,285,989,1 +993,iron-jugulis,993,13,1110,285,990,1 +994,iron-moth,994,12,360,285,988,1 +995,iron-thorns,995,16,3030,285,991,1 +996,frigibax,996,5,170,64,949,1 +997,arctibax,997,8,300,148,950,1 +998,baxcalibur,998,21,2100,300,951,1 +999,gimmighoul,999,3,50,60,976,1 +1000,gholdengo,1000,12,300,275,977,1 +1001,wo-chien,1001,15,742,285,996,1 +1002,chien-pao,1002,19,1522,285,995,1 +1003,ting-lu,1003,27,6997,285,994,1 +1004,chi-yu,1004,4,49,285,997,1 +1005,roaring-moon,1005,20,3800,295,985,1 +1006,iron-valiant,1006,14,350,295,993,1 +1007,koraidon,1007,25,3030,335,998,1 +1008,miraidon,1008,35,2400,335,999,1 +1009,walking-wake,1009,35,2800,295,1093,1 +1010,iron-leaves,1010,15,1250,295,1094,1 +1011,dipplin,1011,4,97,170,1095,1 +1012,poltchageist,1012,1,11,62,1096,1 +1013,sinistcha,1013,2,22,178,1097,1 +1014,okidogi,1014,18,922,278,1098,1 +1015,munkidori,1015,10,122,278,1099,1 +1016,fezandipiti,1016,14,301,278,1100,1 +1017,ogerpon,1017,12,398,275,1101,1 +1018,archaludon,1018,20,600,300,1102,1 +1019,hydrapple,1019,18,930,270,1103,1 +1020,gouging-fire,1020,35,5900,295,1104,1 +1021,raging-bolt,1021,52,4800,295,1105,1 +1022,iron-boulder,1022,15,1625,295,1106,1 +1023,iron-crown,1023,16,1560,295,1107,1 +1024,terapagos,1024,2,65,90,1108,1 +1025,pecharunt,1025,3,3,300,1109,1 10001,deoxys-attack,386,17,608,270,515,0 10002,deoxys-defense,386,17,608,270,516,0 10003,deoxys-speed,386,17,608,270,517,0 diff --git a/data/v2/csv/pokemon_species_flavor_text.csv b/data/v2/csv/pokemon_species_flavor_text.csv index fd832e6f7..2bb905dbf 100644 --- a/data/v2/csv/pokemon_species_flavor_text.csv +++ b/data/v2/csv/pokemon_species_flavor_text.csv @@ -183571,4 +183571,38 @@ gives rise to the budding of fresh life across Hisui." 1007,40,9,"This seems to be the Winged King mentioned in an old expedition journal. It was said to have split the land with its bare fists." 1007,41,9,"This Pokémon resembles Cyclizar, but it is far burlier and more ferocious. Nothing is known about its ecology or other features." 1008,40,9,"Much remains unknown about this creature. It resembles Cyclizar, but it is far more ruthless and powerful." -1008,41,9,"This seems to be the Iron Serpent mentioned in an old book. The Iron Serpent is said to have turned the land to ash with its lightning." \ No newline at end of file +1008,41,9,"This seems to be the Iron Serpent mentioned in an old book. The Iron Serpent is said to have turned the land to ash with its lightning." +1009,40,9,"This ferocious creature is shrouded in mystery. It's named after an aquatic monster mentioned in an old expedition journal." +1009,41,9,"It resembles an illustration published in a paranormal magazine, said to be a depiction of a super-ancient Suicune." +1010,40,9,"Many of its physical characteristics match those of a Virizion from the future that was covered in a paranormal magazine." +1010,41,9,"According to the few eyewitness accounts that exist, it used its shining blades to julienne large trees and boulders." +1011,40,9,"Dipplin is two creatures in one Pokémon. Its evolution was triggered by a special apple grown only in one place." +1011,41,9,"The head sticking out belongs to the fore-wyrm, while the tail belongs to the core-wyrm. The two share one apple and help each other out." +1012,40,9,"Supposedly, the regrets of a tea ceremony master who died before perfecting his craft lingered in some matcha and became a Pokémon." +1012,41,9,"Poltchageist looks like a regional form of Sinistea, but it was recently discovered that the two Pokémon are entirely unrelated." +1013,40,9,"It pretends to be tea, trying to fool people into drinking it so it can drain their life-force. Its ruse is generally unsuccessful." +1013,41,9,"It prefers cool, dark places, such as the back of a shelf or the space beneath a home's floorboards. It wanders in search of prey after sunset." +1014,40,9,"After all its muscles were stimulated by the toxic chain around its neck, Okidogi transformed and gained a powerful physique." +1014,41,9,"Okidogi is a ruffian with a short temper. It can pulverize anything by swinging around the chain on its neck." +1015,40,9,"The chain is made from toxins that enhance capabilities. It stimulated Munkidori's brain and caused the Pokémon's psychic powers to bloom." +1015,41,9,"Munkidori keeps itself somewhere safe while it toys with its foes, using psychokinesis to induce intense dizziness." +1016,40,9,"Fezandipiti owes its beautiful looks and lovely voice to the toxic stimulants emanating from the chain wrapped around its body." +1016,41,9,"Fezandipiti beats its glossy wings to scatter pheromones that captivate people and Pokémon." +1017,40,9,"This Pokémon's type changes based on which mask it's wearing. It confounds its enemies with nimble movements and kicks." +1017,41,9,"This mischief-loving Pokémon is full of curiosity. It battles by drawing out the type-based energy contained within its masks." +1018,40,9,"It gathers static electricity from its surroundings. The beams it launches when down on all fours are tremendously powerful." +1018,41,9,"It digs holes on mountains, searching for food. It’s so durable that being caught in a cave-in won’t faze it." +1019,40,9,"Seven syrpents live inside an apple made of syrup. The syrpent in the center is the commander." +1019,41,9,"These capricious syrpents have banded together. On the rare occasion that their moods align, their true power is unleashed." +1020,40,9,"There are scant few reports of this creature being sighted. One short video shows it rampaging and spouting pillars of flame." +1020,41,9,"It resembles an eerie Pokémon once shown in a paranormal magazine. That Pokémon was said to be an Entei regenerated from a fossil." +1021,40,9,"It's said to incinerate everything around it with lightning launched from its fur. Very little is known about this creature." +1021,41,9,"It bears resemblance to a Pokémon that became a hot topic for a short while after a paranormal magazine touted it as Raikou's ancestor." +1022,40,9,"It resembles a Pokémon described in a dubious magazine as a Terrakion that had been modified by an evil organization." +1022,41,9,"It was named after a mysterious object recorded in an old book. Its body seems to be metallic." +1023,40,9,"It resembles a mysterious object introduced in a paranormal magazine as a cutting-edge weapon shaped like a Cobalion." +1023,41,9,"There was supposedly an incident in which it launched shining blades to cut everything around it to pieces. Little else is known about it." +1024,40,9,"Terapagos protects itself using its power to transform energy into hard crystals. This Pokémon is the source of the Terastal phenomenon." +1024,41,9,"It’s thought that this Pokémon lived in ancient Paldea until it got caught in seismic shifts and went extinct." +1025,40,9,"It feeds others toxic mochi that draw out desires and capabilities. Those who eat the mochi fall under Pecharunt’s control, chained to its will." +1025,41,9,"Its peach-shaped shell serves as storage for a potent poison. It makes poisonous mochi and serves them to people and Pokémon." diff --git a/data/v2/csv/pokemon_species_names.csv b/data/v2/csv/pokemon_species_names.csv index e0217ceef..260017cec 100644 --- a/data/v2/csv/pokemon_species_names.csv +++ b/data/v2/csv/pokemon_species_names.csv @@ -11116,7 +11116,7 @@ pokemon_species_id,local_language_id,name,genus 1011,6,Sirapfel, 1011,7,Dipplin, 1011,8,Dipplin, -1011,9,Dipplin, +1011,9,Dipplin,Candy Apple Pokémon 1011,11,カミッチュ, 1011,12,裹蜜虫, 1012,1,チャデス, @@ -11126,7 +11126,7 @@ pokemon_species_id,local_language_id,name,genus 1012,6,Mortcha, 1012,7,Poltchageist, 1012,8,Poltchageist, -1012,9,Poltchageist, +1012,9,Poltchageist,Matcha Pokémon 1012,11,チャデス, 1012,12,斯魔茶, 1013,1,ヤバソチャ, @@ -11136,7 +11136,7 @@ pokemon_species_id,local_language_id,name,genus 1013,6,Fatalitcha, 1013,7,Sinistcha, 1013,8,Sinistcha, -1013,9,Sinistcha, +1013,9,Sinistcha,Matcha Pokémon 1013,11,ヤバソチャ, 1013,12,来悲粗茶, 1014,1,イイネイヌ, @@ -11146,7 +11146,7 @@ pokemon_species_id,local_language_id,name,genus 1014,6,Boninu, 1014,7,Okidogi, 1014,8,Okidogi, -1014,9,Okidogi, +1014,9,Okidogi,Retainer Pokémon 1014,11,イイネイヌ, 1014,12,够赞狗, 1015,1,マシマシラ, @@ -11156,7 +11156,7 @@ pokemon_species_id,local_language_id,name,genus 1015,6,Benesaru, 1015,7,Munkidori, 1015,8,Munkidori, -1015,9,Munkidori, +1015,9,Munkidori,Retainer Pokémon 1015,11,マシマシラ, 1015,12,愿增猿, 1016,1,キチキギス, @@ -11166,7 +11166,7 @@ pokemon_species_id,local_language_id,name,genus 1016,6,Beatori, 1016,7,Fezandipiti, 1016,8,Fezandipiti, -1016,9,Fezandipiti, +1016,9,Fezandipiti,Retainer Pokémon 1016,11,キチキギス, 1016,12,吉雉鸡, 1017,1,オーガポン, @@ -11176,7 +11176,7 @@ pokemon_species_id,local_language_id,name,genus 1017,6,Ogerpon, 1017,7,Ogerpon, 1017,8,Ogerpon, -1017,9,Ogerpon, +1017,9,Ogerpon,Mask Pokémon 1017,11,オーガポン, 1017,12,厄诡椪, 1018,1,ブリジュラス,ごうきんポケモン @@ -11206,7 +11206,7 @@ pokemon_species_id,local_language_id,name,genus 1020,6,Keilflamme, 1020,7,Flamariete, 1020,8,Vampeaguzze, -1020,9,Gouging Fire,Paladox Pokémon +1020,9,Gouging Fire,Paradox Pokémon 1020,11,ウガツホムラ,パラドックスポケモン 1020,12,破空焰, 1021,1,タケルライコ,パラドックスポケモン @@ -11216,7 +11216,7 @@ pokemon_species_id,local_language_id,name,genus 1021,6,Furienblitz, 1021,7,Electrofuria, 1021,8,Furiatonante, -1021,9,Raging Bolt,Paladox Pokémon +1021,9,Raging Bolt,Paradox Pokémon 1021,11,タケルライコ,パラドックスポケモン 1021,12,猛雷鼓, 1022,1,テツノイワオ,パラドックスポケモン @@ -11226,7 +11226,7 @@ pokemon_species_id,local_language_id,name,genus 1022,6,Eisenfels, 1022,7,Ferromole, 1022,8,Massoferreo, -1022,9,Iron Boulder,Paladox Pokémon +1022,9,Iron Boulder,Paradox Pokémon 1022,11,テツノイワオ,パラドックスポケモン 1022,12,鐵磐岩, 1023,1,テツノカシラ,パラドックスポケモン @@ -11236,7 +11236,7 @@ pokemon_species_id,local_language_id,name,genus 1023,6,Eisenhaupt, 1023,7,Ferrotesta, 1023,8,Capoferreo, -1023,9,Iron Crown,Paladox Pokémon +1023,9,Iron Crown,Paradox Pokémon 1023,11,テツノカシラ,パラドックスポケモン 1023,12,鐵頭殼, 1024,1,テラパゴス,テラスタルポケモン diff --git a/data/v2/csv/type_names.csv b/data/v2/csv/type_names.csv index 5a4b834a0..a57cba16c 100644 --- a/data/v2/csv/type_names.csv +++ b/data/v2/csv/type_names.csv @@ -179,6 +179,16 @@ type_id,local_language_id,name 18,9,Fairy 18,11,フェアリー 18,12,妖精 +19,1,ステラ +19,2, Stella +19,3, 스텔라 +19,4,星晶 +19,5,Stellaire +19,6,Stellar +19,7,Astral +19,8,Astrale +19,9,Stellar +19,11,ステラ 10001,1,??? 10001,3,??? 10001,4,??? diff --git a/data/v2/csv/types.csv b/data/v2/csv/types.csv index 0603c393f..d0ec10c32 100644 --- a/data/v2/csv/types.csv +++ b/data/v2/csv/types.csv @@ -17,5 +17,6 @@ id,identifier,generation_id,damage_class_id 16,dragon,1,3 17,dark,2,3 18,fairy,6, +19,stellar,9, 10001,unknown,2, 10002,shadow,3, diff --git a/default.nix b/default.nix new file mode 100644 index 000000000..f5ae82fe7 --- /dev/null +++ b/default.nix @@ -0,0 +1,42 @@ +with import { }; + +let + pythonPackages = python3Packages; +in pkgs.mkShell rec { + name = "impurePythonEnv"; + venvDir = "./.venv"; + buildInputs = [ + python310Packages.python + python310Packages.venvShellHook + + # python310Packages.coverage + # python310Packages.python-mimeparse + # python310Packages.python-dateutil + # python310Packages.drf-spectacular + # python310Packages.djangorestframework + # python310Packages.django-redis + # python310Packages.django-cors-headers + + # Required dependancies + black + taglib + openssl + git + libxml2 + libxslt + libzip + zlib + ]; + + # Run this command, only after creating the virtual environment + postVenvCreation = '' + unset SOURCE_DATE_EPOCH + pip install -r requirements.txt + ''; + + postShellHook = '' + # allow pip to install wheels + unset SOURCE_DATE_EPOCH + ''; + +} diff --git a/openapi.yml b/openapi.yml new file mode 100644 index 000000000..f262ee3bd --- /dev/null +++ b/openapi.yml @@ -0,0 +1,9157 @@ +openapi: 3.1.0 +info: + title: PokéAPI + version: 2.7.0 + description: "All the Pokémon data you'll ever need in one place, easily accessible\ + \ through a modern free open-source RESTful API.\n\n## What is this?\n\nThis is\ + \ a full RESTful API linked to an extensive database detailing everything about\ + \ the Pokémon main game series.\n\nWe've covered everything from Pokémon to Berry\ + \ Flavors.\n\n## Where do I start?\n\nWe have awesome [documentation](https://pokeapi.co/docs/v2)\ + \ on how to use this API. It takes minutes to get started.\n\nThis API will always\ + \ be publicly available and will never require any extensive setup process to\ + \ consume.\n\nCreated by [**Paul Hallett**(]https://github.com/phalt) and other\ + \ [**PokéAPI contributors***](https://github.com/PokeAPI/pokeapi#contributing)\ + \ around the world. Pokémon and Pokémon character names are trademarks of Nintendo.\n\ + \ " +paths: + /api/v2/ability/: + get: + operationId: ability_list + description: Abilities provide passive effects for Pokémon in battle or in the + overworld. Pokémon have multiple possible abilities but can have only one + ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) + for greater detail. + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedAbilitySummaryList' + description: '' + /api/v2/ability/{id}/: + get: + operationId: ability_retrieve + description: Abilities provide passive effects for Pokémon in battle or in the + overworld. Pokémon have multiple possible abilities but can have only one + ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) + for greater detail. + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this ability. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/AbilityDetail' + description: '' + /api/v2/berry/: + get: + operationId: berry_list + description: 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](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater + detail. + summary: List berries + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - berries + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedBerrySummaryList' + description: '' + /api/v2/berry-firmness/: + get: + operationId: berry_firmness_list + description: Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) + for greater detail. + summary: List berry firmness + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - berries + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedBerryFirmnessSummaryList' + description: '' + /api/v2/berry-firmness/{id}/: + get: + operationId: berry_firmness_retrieve + description: Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) + for greater detail. + summary: Get berry by firmness + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this berry firmness. + required: true + tags: + - berries + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BerryFirmnessDetail' + description: '' + /api/v2/berry-flavor/: + get: + operationId: berry_flavor_list + description: Flavors determine whether a Pokémon will benefit or suffer from + eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) + for greater detail. + summary: List berry flavors + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - berries + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedBerryFlavorSummaryList' + description: '' + /api/v2/berry-flavor/{id}/: + get: + operationId: berry_flavor_retrieve + description: Flavors determine whether a Pokémon will benefit or suffer from + eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) + for greater detail. + summary: Get berries by flavor + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this berry flavor. + required: true + tags: + - berries + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BerryFlavorDetail' + description: '' + /api/v2/berry/{id}/: + get: + operationId: berry_retrieve + description: 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](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater + detail. + summary: Get a berry + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this berry. + required: true + tags: + - berries + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/BerryDetail' + description: '' + /api/v2/characteristic/: + get: + operationId: characteristic_list + description: Characteristics indicate which stat contains a Pokémon's highest + IV. A Pokémon's Characteristic is determined by the remainder of its highest + IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) + for greater detail. + summary: List charecterictics + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedCharacteristicSummaryList' + description: '' + /api/v2/characteristic/{id}/: + get: + operationId: characteristic_retrieve + description: Characteristics indicate which stat contains a Pokémon's highest + IV. A Pokémon's Characteristic is determined by the remainder of its highest + IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) + for greater detail. + summary: Get characteristic + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this characteristic. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CharacteristicDetail' + description: '' + /api/v2/contest-effect/: + get: + operationId: contest_effect_list + description: Contest effects refer to the effects of moves when used in contests. + summary: List contest effects + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - contests + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedContestEffectSummaryList' + description: '' + /api/v2/contest-effect/{id}/: + get: + operationId: contest_effect_retrieve + description: Contest effects refer to the effects of moves when used in contests. + summary: Get contest effect + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this contest effect. + required: true + tags: + - contests + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContestEffectDetail' + description: '' + /api/v2/contest-type/: + get: + operationId: contest_type_list + description: Contest types are categories judges used to weigh a Pokémon's condition + in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) + for greater detail. + summary: List contest types + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - contests + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedContestTypeSummaryList' + description: '' + /api/v2/contest-type/{id}/: + get: + operationId: contest_type_retrieve + description: Contest types are categories judges used to weigh a Pokémon's condition + in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) + for greater detail. + summary: Get contest type + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this contest type. + required: true + tags: + - contests + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ContestTypeDetail' + description: '' + /api/v2/egg-group/: + get: + operationId: egg_group_list + description: Egg Groups are categories which determine which Pokémon are able + to interbreed. Pokémon may belong to either one or two Egg Groups. Check out + [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater + detail. + summary: List egg groups + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEggGroupSummaryList' + description: '' + /api/v2/egg-group/{id}/: + get: + operationId: egg_group_retrieve + description: Egg Groups are categories which determine which Pokémon are able + to interbreed. Pokémon may belong to either one or two Egg Groups. Check out + [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater + detail. + summary: Get egg group + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this egg group. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EggGroupDetail' + description: '' + /api/v2/encounter-condition/: + get: + operationId: encounter_condition_list + description: Conditions which affect what pokemon might appear in the wild, + e.g., day or night. + summary: List encounter conditions + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - encounters + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEncounterConditionSummaryList' + description: '' + /api/v2/encounter-condition-value/: + get: + operationId: encounter_condition_value_list + description: Encounter condition values are the various states that an encounter + condition can have, i.e., time of day can be either day or night. + summary: List encounter condition values + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - encounters + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEncounterConditionValueSummaryList' + description: '' + /api/v2/encounter-condition-value/{id}/: + get: + operationId: encounter_condition_value_retrieve + description: Encounter condition values are the various states that an encounter + condition can have, i.e., time of day can be either day or night. + summary: Get encounter condition value + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this encounter condition value. + required: true + tags: + - encounters + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EncounterConditionValueDetail' + description: '' + /api/v2/encounter-condition/{id}/: + get: + operationId: encounter_condition_retrieve + description: Conditions which affect what pokemon might appear in the wild, + e.g., day or night. + summary: Get encounter condition + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this encounter condition. + required: true + tags: + - encounters + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EncounterConditionDetail' + description: '' + /api/v2/encounter-method/: + get: + operationId: encounter_method_list + description: Methods by which the player might can encounter Pokémon in the + wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail. + summary: List encounter methods + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - encounters + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEncounterMethodSummaryList' + description: '' + /api/v2/encounter-method/{id}/: + get: + operationId: encounter_method_retrieve + description: Methods by which the player might can encounter Pokémon in the + wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail. + summary: Get encounter method + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this encounter method. + required: true + tags: + - encounters + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EncounterMethodDetail' + description: '' + /api/v2/evolution-chain/: + get: + operationId: evolution_chain_list + description: Evolution chains are essentially family trees. They start with + the lowest stage within a family and detail evolution conditions for each + as well as Pokémon they can evolve into up through the hierarchy. + summary: List evolution chains + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - evolution + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEvolutionChainSummaryList' + description: '' + /api/v2/evolution-chain/{id}/: + get: + operationId: evolution_chain_retrieve + description: Evolution chains are essentially family trees. They start with + the lowest stage within a family and detail evolution conditions for each + as well as Pokémon they can evolve into up through the hierarchy. + summary: Get evolution chain + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this evolution chain. + required: true + tags: + - evolution + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EvolutionChainDetail' + description: '' + /api/v2/evolution-trigger/: + get: + operationId: evolution_trigger_list + description: Evolution triggers are the events and conditions that cause a Pokémon + to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) + for greater detail. + summary: List evolution triggers + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - evolution + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedEvolutionTriggerSummaryList' + description: '' + /api/v2/evolution-trigger/{id}/: + get: + operationId: evolution_trigger_retrieve + description: Evolution triggers are the events and conditions that cause a Pokémon + to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) + for greater detail. + summary: Get evolution trigger + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this evolution trigger. + required: true + tags: + - evolution + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/EvolutionTriggerDetail' + description: '' + /api/v2/gender/: + get: + operationId: gender_list + description: Genders were introduced in Generation II for the purposes of breeding + Pokémon but can also result in visual differences or even different evolutionary + lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) + for greater detail. + summary: List genders + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedGenderSummaryList' + description: '' + /api/v2/gender/{id}/: + get: + operationId: gender_retrieve + description: Genders were introduced in Generation II for the purposes of breeding + Pokémon but can also result in visual differences or even different evolutionary + lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) + for greater detail. + summary: Get gender + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this gender. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GenderDetail' + description: '' + /api/v2/generation/: + get: + operationId: generation_list + description: A generation is a grouping of the Pokémon games that separates + them based on the Pokémon they include. In each generation, a new set of Pokémon, + Moves, Abilities and Types that did not exist in the previous generation are + released. + summary: List genrations + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedGenerationSummaryList' + description: '' + /api/v2/generation/{id}/: + get: + operationId: generation_retrieve + description: A generation is a grouping of the Pokémon games that separates + them based on the Pokémon they include. In each generation, a new set of Pokémon, + Moves, Abilities and Types that did not exist in the previous generation are + released. + summary: Get genration + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this generation. + required: true + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GenerationDetail' + description: '' + /api/v2/growth-rate/: + get: + operationId: growth_rate_list + description: Growth rates are the speed with which Pokémon gain levels through + experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) + for greater detail. + summary: List growth rates + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedGrowthRateSummaryList' + description: '' + /api/v2/growth-rate/{id}/: + get: + operationId: growth_rate_retrieve + description: Growth rates are the speed with which Pokémon gain levels through + experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) + for greater detail. + summary: Get growth rate + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this growth rate. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/GrowthRateDetail' + description: '' + /api/v2/item/: + get: + operationId: item_list + description: 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. + summary: List items + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemSummaryList' + description: '' + /api/v2/item-attribute/: + get: + operationId: item_attribute_list + description: Item attributes define particular aspects of items, e.g."usable + in battle" or "consumable". + summary: List item attributes + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemAttributeSummaryList' + description: '' + /api/v2/item-attribute/{id}/: + get: + operationId: item_attribute_retrieve + description: Item attributes define particular aspects of items, e.g."usable + in battle" or "consumable". + summary: Get item attribute + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item attribute. + required: true + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemAttributeDetail' + description: '' + /api/v2/item-category/: + get: + operationId: item_category_list + description: Item categories determine where items will be placed in the players + bag. + summary: List item categories + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemCategorySummaryList' + description: '' + /api/v2/item-category/{id}/: + get: + operationId: item_category_retrieve + description: Item categories determine where items will be placed in the players + bag. + summary: Get item category + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item category. + required: true + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemCategoryDetail' + description: '' + /api/v2/item-fling-effect/: + get: + operationId: item_fling_effect_list + description: The various effects of the move"Fling" when used with different + items. + summary: List item fling effects + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemFlingEffectSummaryList' + description: '' + /api/v2/item-fling-effect/{id}/: + get: + operationId: item_fling_effect_retrieve + description: The various effects of the move"Fling" when used with different + items. + summary: Get item fling effect + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item fling effect. + required: true + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemFlingEffectDetail' + description: '' + /api/v2/item-pocket/: + get: + operationId: item_pocket_list + description: Pockets within the players bag used for storing items by category. + summary: List item pockets + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedItemPocketSummaryList' + description: '' + /api/v2/item-pocket/{id}/: + get: + operationId: item_pocket_retrieve + description: Pockets within the players bag used for storing items by category. + summary: Get item pocket + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item pocket. + required: true + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemPocketDetail' + description: '' + /api/v2/item/{id}/: + get: + operationId: item_retrieve + description: 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. + summary: Get item + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this item. + required: true + tags: + - items + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/ItemDetail' + description: '' + /api/v2/language/: + get: + operationId: language_list + description: Languages for translations of API resource information. + summary: List languages + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - utility + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLanguageSummaryList' + description: '' + /api/v2/language/{id}/: + get: + operationId: language_retrieve + description: Languages for translations of API resource information. + summary: Get language + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this language. + required: true + tags: + - utility + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LanguageDetail' + description: '' + /api/v2/location/: + get: + operationId: location_list + description: Locations that can be visited within the games. Locations make + up sizable portions of regions, like cities or routes. + summary: List locations + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLocationSummaryList' + description: '' + /api/v2/location-area/: + get: + operationId: location_area_list + description: 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. + summary: List location areas + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedLocationAreaSummaryList' + description: '' + /api/v2/location-area/{id}/: + get: + operationId: location_area_retrieve + description: 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. + summary: Get location area + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this location area. + required: true + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LocationAreaDetail' + description: '' + /api/v2/location/{id}/: + get: + operationId: location_retrieve + description: Locations that can be visited within the games. Locations make + up sizable portions of regions, like cities or routes. + summary: Get location + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this location. + required: true + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/LocationDetail' + description: '' + /api/v2/machine/: + get: + operationId: machine_list + description: 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. + summary: List machines + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - machines + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMachineSummaryList' + description: '' + /api/v2/machine/{id}/: + get: + operationId: machine_retrieve + description: 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. + summary: Get machine + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this machine. + required: true + tags: + - machines + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MachineDetail' + description: '' + /api/v2/move/: + get: + operationId: move_list + description: Moves are the skills of Pokémon in battle. In battle, a Pokémon + uses one move each turn. Some moves (including those learned by Hidden Machine) + can be used outside of battle as well, usually for the purpose of removing + obstacles or exploring new areas. + summary: List moves + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveSummaryList' + description: '' + /api/v2/move-ailment/: + get: + operationId: move_ailment_list + description: Move Ailments are status conditions caused by moves used during + battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) + for greater detail. + summary: List move meta ailments + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveMetaAilmentSummaryList' + description: '' + /api/v2/move-ailment/{id}/: + get: + operationId: move_ailment_retrieve + description: Move Ailments are status conditions caused by moves used during + battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) + for greater detail. + summary: Get move meta ailment + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move meta ailment. + required: true + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveMetaAilmentDetail' + description: '' + /api/v2/move-battle-style/: + get: + operationId: move_battle_style_list + description: Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) + for greater detail. + summary: List move battle styles + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveBattleStyleSummaryList' + description: '' + /api/v2/move-battle-style/{id}/: + get: + operationId: move_battle_style_retrieve + description: Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) + for greater detail. + summary: Get move battle style + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move battle style. + required: true + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveBattleStyleDetail' + description: '' + /api/v2/move-category/: + get: + operationId: move_category_list + description: Very general categories that loosely group move effects. + summary: List move meta categories + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveMetaCategorySummaryList' + description: '' + /api/v2/move-category/{id}/: + get: + operationId: move_category_retrieve + description: Very general categories that loosely group move effects. + summary: Get move meta category + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move meta category. + required: true + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveMetaCategoryDetail' + description: '' + /api/v2/move-damage-class/: + get: + operationId: move_damage_class_list + description: Damage classes moves can have, e.g. physical, special, or non-damaging. + summary: List move damage classes + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveDamageClassSummaryList' + description: '' + /api/v2/move-damage-class/{id}/: + get: + operationId: move_damage_class_retrieve + description: Damage classes moves can have, e.g. physical, special, or non-damaging. + summary: Get move damage class + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move damage class. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveDamageClassDetail' + description: '' + /api/v2/move-learn-method/: + get: + operationId: move_learn_method_list + description: Methods by which Pokémon can learn moves. + summary: List move learn methods + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveLearnMethodSummaryList' + description: '' + /api/v2/move-learn-method/{id}/: + get: + operationId: move_learn_method_retrieve + description: Methods by which Pokémon can learn moves. + summary: Get move learn method + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move learn method. + required: true + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveLearnMethodDetail' + description: '' + /api/v2/move-target/: + get: + operationId: move_target_list + description: Targets moves can be directed at during battle. Targets can be + Pokémon, environments or even other moves. + summary: List move targets + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedMoveTargetSummaryList' + description: '' + /api/v2/move-target/{id}/: + get: + operationId: move_target_retrieve + description: Targets moves can be directed at during battle. Targets can be + Pokémon, environments or even other moves. + summary: Get move target + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move target. + required: true + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveTargetDetail' + description: '' + /api/v2/move/{id}/: + get: + operationId: move_retrieve + description: Moves are the skills of Pokémon in battle. In battle, a Pokémon + uses one move each turn. Some moves (including those learned by Hidden Machine) + can be used outside of battle as well, usually for the purpose of removing + obstacles or exploring new areas. + summary: Get move + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this move. + required: true + tags: + - moves + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/MoveDetail' + description: '' + /api/v2/nature/: + get: + operationId: nature_list + description: Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) + for greater detail. + summary: List natures + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedNatureSummaryList' + description: '' + /api/v2/nature/{id}/: + get: + operationId: nature_retrieve + description: Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) + for greater detail. + summary: Get nature + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this nature. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/NatureDetail' + description: '' + /api/v2/pal-park-area/: + get: + operationId: pal_park_area_list + description: Areas used for grouping Pokémon encounters in Pal Park. They're + like habitats that are specific to Pal Park. + summary: List pal park areas + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPalParkAreaSummaryList' + description: '' + /api/v2/pal-park-area/{id}/: + get: + operationId: pal_park_area_retrieve + description: Areas used for grouping Pokémon encounters in Pal Park. They're + like habitats that are specific to Pal Park. + summary: Get pal park area + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pal park area. + required: true + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PalParkAreaDetail' + description: '' + /api/v2/pokeathlon-stat/: + get: + operationId: pokeathlon_stat_list + description: Pokeathlon Stats are different attributes of a Pokémon's performance + in Pokéathlons. In Pokéathlons, competitions happen on different courses; + one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) + for greater detail. + summary: List pokeathlon stats + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokeathlonStatSummaryList' + description: '' + /api/v2/pokeathlon-stat/{id}/: + get: + operationId: pokeathlon_stat_retrieve + description: Pokeathlon Stats are different attributes of a Pokémon's performance + in Pokéathlons. In Pokéathlons, competitions happen on different courses; + one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) + for greater detail. + summary: Get pokeathlon stat + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokeathlon stat. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokeathlonStatDetail' + description: '' + /api/v2/pokedex/: + get: + operationId: pokedex_list + description: 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](http://bulbapedia.bulbagarden.net/wiki/Pokedex) + for greater detail. + summary: List pokedex + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokedexSummaryList' + description: '' + /api/v2/pokedex/{id}/: + get: + operationId: pokedex_retrieve + description: 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](http://bulbapedia.bulbagarden.net/wiki/Pokedex) + for greater detail. + summary: Get pokedex + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokedex. + required: true + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokedexDetail' + description: '' + /api/v2/pokemon/: + get: + operationId: pokemon_list + description: Pokémon are the creatures that inhabit the world of the Pokémon + games. They can be caught using Pokéballs and trained by battling with other + Pokémon. Each Pokémon belongs to a specific species but may take on a variant + which makes it differ from other Pokémon of the same species, such as base + stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) + for greater detail. + summary: List pokemon + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonSummaryList' + description: '' + /api/v2/pokemon-color/: + get: + operationId: pokemon_color_list + description: Colors used for sorting Pokémon in a Pokédex. The color listed + in the Pokédex is usually the color most apparent or covering each Pokémon's + body. No orange category exists; Pokémon that are primarily orange are listed + as red or brown. + summary: List pokemon colors + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonColorSummaryList' + description: '' + /api/v2/pokemon-color/{id}/: + get: + operationId: pokemon_color_retrieve + description: Colors used for sorting Pokémon in a Pokédex. The color listed + in the Pokédex is usually the color most apparent or covering each Pokémon's + body. No orange category exists; Pokémon that are primarily orange are listed + as red or brown. + summary: Get pokemon color + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon color. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonColorDetail' + description: '' + /api/v2/pokemon-form/: + get: + operationId: pokemon_form_list + description: Some Pokémon may appear in one of multiple, visually different + forms. These differences are purely cosmetic. For variations within a Pokémon + species, which do differ in more than just visuals, the 'Pokémon' entity is + used to represent such a variety. + summary: List pokemon forms + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonFormSummaryList' + description: '' + /api/v2/pokemon-form/{id}/: + get: + operationId: pokemon_form_retrieve + description: Some Pokémon may appear in one of multiple, visually different + forms. These differences are purely cosmetic. For variations within a Pokémon + species, which do differ in more than just visuals, the 'Pokémon' entity is + used to represent such a variety. + summary: Get pokemon form + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon form. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonFormDetail' + description: '' + /api/v2/pokemon-habitat/: + get: + operationId: pokemon_habitat_list + description: Habitats are generally different terrain Pokémon can be found in + but can also be areas designated for rare or legendary Pokémon. + summary: List pokemom habitas + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonHabitatSummaryList' + description: '' + /api/v2/pokemon-habitat/{id}/: + get: + operationId: pokemon_habitat_retrieve + description: Habitats are generally different terrain Pokémon can be found in + but can also be areas designated for rare or legendary Pokémon. + summary: Get pokemom habita + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon habitat. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonHabitatDetail' + description: '' + /api/v2/pokemon-shape/: + get: + operationId: pokemon_shape_list + description: Shapes used for sorting Pokémon in a Pokédex. + summary: List pokemon shapes + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonShapeSummaryList' + description: '' + /api/v2/pokemon-shape/{id}/: + get: + operationId: pokemon_shape_retrieve + description: Shapes used for sorting Pokémon in a Pokédex. + summary: Get pokemon shape + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon shape. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonShapeDetail' + description: '' + /api/v2/pokemon-species/: + get: + operationId: pokemon_species_list + description: A Pokémon Species forms the basis for at least one Pokémon. Attributes + of a Pokémon species are shared across all varieties of Pokémon within the + species. A good example is Wormadam; Wormadam is the species which can be + found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. + summary: List pokemon species + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedPokemonSpeciesSummaryList' + description: '' + /api/v2/pokemon-species/{id}/: + get: + operationId: pokemon_species_retrieve + description: A Pokémon Species forms the basis for at least one Pokémon. Attributes + of a Pokémon species are shared across all varieties of Pokémon within the + species. A good example is Wormadam; Wormadam is the species which can be + found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. + summary: Get pokemon species + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon species. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonSpeciesDetail' + description: '' + /api/v2/pokemon/{id}/: + get: + operationId: pokemon_retrieve + description: Pokémon are the creatures that inhabit the world of the Pokémon + games. They can be caught using Pokéballs and trained by battling with other + Pokémon. Each Pokémon belongs to a specific species but may take on a variant + which makes it differ from other Pokémon of the same species, such as base + stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) + for greater detail. + summary: Get pokemon + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this pokemon. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PokemonDetail' + description: '' + /api/v2/pokemon/{pokemon_id}/encounters: + get: + operationId: pokemon_encounters_retrieve + description: Handles Pokemon Encounters as a sub-resource. + summary: Get pokemon encounter + parameters: + - in: path + name: pokemon_id + schema: + type: string + pattern: ^\d+$ + required: true + tags: + - encounters + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + type: array + items: + type: object + required: + - location_area + - version_details + properties: + location_area: + type: object + required: + - name + - url + properties: + name: + type: string + example: cerulean-city-area + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/location-area/281/ + version_details: + type: array + items: + type: object + required: + - encounter_details + - max_chance + - version + properties: + encounter_details: + type: array + items: + type: object + required: + - chance + - condition_values + - max_level + - method + - min_level + properties: + chance: + type: number + example: 100 + condition_values: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + example: story-progress-beat-red + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/encounter-condition-value/55/ + max_level: + type: number + example: 10 + method: + type: object + required: + - name + - url + properties: + name: + type: string + example: gift + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/encounter-method/18/ + min_level: + type: number + example: 10 + max_chance: + type: number + example: 100 + version: + type: object + required: + - name + - url + properties: + name: + type: string + example: red + url: + type: string + format: uri + example: https://pokeapi.co/api/v2/version/1/ + description: '' + /api/v2/region/: + get: + operationId: region_list + description: A region is an organized area of the Pokémon world. Most often, + the main difference between regions is the species of Pokémon that can be + encountered within them. + summary: List regions + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedRegionSummaryList' + description: '' + /api/v2/region/{id}/: + get: + operationId: region_retrieve + description: A region is an organized area of the Pokémon world. Most often, + the main difference between regions is the species of Pokémon that can be + encountered within them. + summary: Get region + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this region. + required: true + tags: + - location + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/RegionDetail' + description: '' + /api/v2/stat/: + get: + operationId: stat_list + description: Stats determine certain aspects of battles. Each Pokémon has a + value for each stat which grows as they gain levels and can be altered momentarily + by effects in battles. + summary: List stats + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedStatSummaryList' + description: '' + /api/v2/stat/{id}/: + get: + operationId: stat_retrieve + description: Stats determine certain aspects of battles. Each Pokémon has a + value for each stat which grows as they gain levels and can be altered momentarily + by effects in battles. + summary: Get stat + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this stat. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/StatDetail' + description: '' + /api/v2/super-contest-effect/: + get: + operationId: super_contest_effect_list + description: Super contest effects refer to the effects of moves when used in + super contests. + summary: List super contest effects + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - contests + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedSuperContestEffectSummaryList' + description: '' + /api/v2/super-contest-effect/{id}/: + get: + operationId: super_contest_effect_retrieve + description: Super contest effects refer to the effects of moves when used in + super contests. + summary: Get super contest effect + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this super contest effect. + required: true + tags: + - contests + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SuperContestEffectDetail' + description: '' + /api/v2/type/: + get: + operationId: type_list + description: 'Types are properties for Pokémon and their moves. Each type has + three properties: which types of Pokémon it is super effective against, which + types of Pokémon it is not very effective against, and which types of Pokémon + it is completely ineffective against.' + summary: List types + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedTypeSummaryList' + description: '' + /api/v2/type/{id}/: + get: + operationId: type_retrieve + description: 'Types are properties for Pokémon and their moves. Each type has + three properties: which types of Pokémon it is super effective against, which + types of Pokémon it is not very effective against, and which types of Pokémon + it is completely ineffective against.' + summary: Get types + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this type. + required: true + tags: + - pokemon + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/TypeDetail' + description: '' + /api/v2/version/: + get: + operationId: version_list + description: Versions of the games, e.g., Red, Blue or Yellow. + summary: List versions + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedVersionSummaryList' + description: '' + /api/v2/version-group/: + get: + operationId: version_group_list + description: Version groups categorize highly similar versions of the games. + summary: List version groups + parameters: + - name: limit + required: false + in: query + description: Number of results to return per page. + schema: + type: integer + - name: offset + required: false + in: query + description: The initial index from which to return the results. + schema: + type: integer + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/PaginatedVersionGroupSummaryList' + description: '' + /api/v2/version-group/{id}/: + get: + operationId: version_group_retrieve + description: Version groups categorize highly similar versions of the games. + summary: Get version group + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this version group. + required: true + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VersionGroupDetail' + description: '' + /api/v2/version/{id}/: + get: + operationId: version_retrieve + description: Versions of the games, e.g., Red, Blue or Yellow. + summary: Get version + parameters: + - in: path + name: id + schema: + type: integer + description: A unique integer value identifying this version. + required: true + tags: + - games + security: + - cookieAuth: [] + - basicAuth: [] + - {} + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/VersionDetail' + description: '' +components: + schemas: + AbilityChange: + type: object + properties: + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + effect_entries: + type: array + items: + $ref: '#/components/schemas/AbilityChangeEffectText' + readOnly: true + required: + - effect_entries + - version_group + AbilityChangeEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + AbilityDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + is_main_series: + type: boolean + generation: + $ref: '#/components/schemas/GenerationSummary' + names: + type: array + items: + $ref: '#/components/schemas/AbilityName' + readOnly: true + effect_entries: + type: array + items: + $ref: '#/components/schemas/AbilityEffectText' + readOnly: true + effect_changes: + type: array + items: + $ref: '#/components/schemas/AbilityChange' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/AbilityFlavorText' + readOnly: true + pokemon: + type: array + items: + type: object + required: + - is_hidden + - slot + - pokemon + properties: + is_hidden: + type: boolean + slot: + type: integer + format: int32 + examples: + - 3 + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - gloom + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon/44/ + readOnly: true + required: + - effect_changes + - effect_entries + - flavor_text_entries + - generation + - id + - name + - names + - pokemon + AbilityEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + short_effect: + type: string + maxLength: 300 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + - short_effect + AbilityFlavorText: + type: object + properties: + flavor_text: + type: string + language: + $ref: '#/components/schemas/LanguageSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - flavor_text + - language + - version_group + AbilityName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + AbilitySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + BerryDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + growth_time: + type: integer + maximum: 2147483647 + minimum: -2147483648 + max_harvest: + type: integer + maximum: 2147483647 + minimum: -2147483648 + natural_gift_power: + type: integer + maximum: 2147483647 + minimum: -2147483648 + size: + type: integer + maximum: 2147483647 + minimum: -2147483648 + smoothness: + type: integer + maximum: 2147483647 + minimum: -2147483648 + soil_dryness: + type: integer + maximum: 2147483647 + minimum: -2147483648 + firmness: + $ref: '#/components/schemas/BerryFirmnessSummary' + flavors: + type: array + items: + type: object + required: + - potency + - flavor + properties: + potency: + type: integer + examples: + - 10 + flavor: + type: object + require: + - name + - url + properties: + name: + type: string + description: The name of the flavor + examples: + - spicy + url: + type: string + format: uri + description: The URL to get more information about the flavor + examples: + - https://pokeapi.co/api/v2/berry-flavor/1/ + readOnly: true + item: + $ref: '#/components/schemas/ItemSummary' + natural_gift_type: + $ref: '#/components/schemas/TypeSummary' + required: + - firmness + - flavors + - growth_time + - id + - item + - max_harvest + - name + - natural_gift_power + - natural_gift_type + - size + - smoothness + - soil_dryness + BerryFirmnessDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + berries: + type: array + items: + $ref: '#/components/schemas/BerrySummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/BerryFirmnessName' + readOnly: true + required: + - berries + - id + - name + - names + BerryFirmnessName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + BerryFirmnessSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + BerryFlavorDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + berries: + type: array + items: + type: object + required: + - potency + - berry + properties: + potency: + type: integer + examples: + - 10 + berry: + type: object + require: + - name + - url + properties: + name: + type: string + description: The name of the berry + examples: + - rowap + url: + type: string + format: uri + description: The URL to get more information about the berry + examples: + - https://pokeapi.co/api/v2/berry/64/ + readOnly: true + contest_type: + $ref: '#/components/schemas/ContestTypeSummary' + names: + type: array + items: + $ref: '#/components/schemas/BerryFlavorName' + readOnly: true + required: + - berries + - contest_type + - id + - name + - names + BerryFlavorName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + BerryFlavorSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + BerrySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + CharacteristicDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + CharacteristicDetail: + type: object + properties: + id: + type: integer + readOnly: true + gene_modulo: + type: integer + possible_values: + type: array + items: + type: integer + format: int32 + examples: + - - 0 + - 5 + - 10 + - 15 + - 20 + - 25 + - 30 + readOnly: true + highest_stat: + $ref: '#/components/schemas/StatSummary' + descriptions: + type: array + items: + $ref: '#/components/schemas/CharacteristicDescription' + readOnly: true + required: + - descriptions + - gene_modulo + - highest_stat + - id + - possible_values + CharacteristicSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + ContestEffectDetail: + type: object + properties: + id: + type: integer + readOnly: true + appeal: + type: integer + maximum: 2147483647 + minimum: -2147483648 + jam: + type: integer + maximum: 2147483647 + minimum: -2147483648 + effect_entries: + type: array + items: + $ref: '#/components/schemas/ContestEffectEffectText' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/ContestEffectFlavorText' + readOnly: true + required: + - appeal + - effect_entries + - flavor_text_entries + - id + - jam + ContestEffectEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + ContestEffectFlavorText: + type: object + properties: + flavor_text: + type: string + maxLength: 500 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - flavor_text + - language + ContestEffectSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + ContestTypeDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + berry_flavor: + allOf: + - $ref: '#/components/schemas/BerryFlavorSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ContestTypeName' + readOnly: true + required: + - berry_flavor + - id + - name + - names + ContestTypeName: + type: object + properties: + name: + type: string + maxLength: 100 + color: + type: string + maxLength: 10 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - color + - language + - name + ContestTypeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EggGroupDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/EggGroupName' + readOnly: true + pokemon_species: + type: array + items: + type: object + required: + - potency + - flavor + properties: + name: + type: string + description: Pokemon species name. + examples: + - bulbasaur + url: + type: string + format: uri + description: The URL to get more information about the species + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ + readOnly: true + required: + - id + - name + - names + - pokemon_species + EggGroupName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EggGroupSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EncounterConditionDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + values: + type: array + items: + $ref: '#/components/schemas/EncounterConditionValueSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/EncounterConditionName' + readOnly: true + required: + - id + - name + - names + - values + EncounterConditionName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EncounterConditionSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EncounterConditionValueDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + condition: + $ref: '#/components/schemas/EncounterConditionSummary' + names: + type: array + items: + $ref: '#/components/schemas/EncounterConditionValueName' + readOnly: true + required: + - condition + - id + - name + - names + EncounterConditionValueName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EncounterConditionValueSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EncounterMethodDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + names: + type: array + items: + $ref: '#/components/schemas/EncounterMethodName' + readOnly: true + required: + - id + - name + - names + EncounterMethodName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EncounterMethodSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + EvolutionChainDetail: + type: object + properties: + id: + type: integer + readOnly: true + baby_trigger_item: + $ref: '#/components/schemas/ItemSummary' + chain: + type: object + required: + - evolution_details + - evolves_to + - is_baby + - species + properties: + evolution_details: + type: array + items: {} + examples: [] + evolves_to: + type: array + items: + type: object + required: + - evolution_details + - evolves_to + - is_baby + - species + properties: + evolution_details: + type: array + items: + type: object + required: + - gender + - held_item + - item + - known_move + - known_move_type + - location + - min_affection + - min_beauty + - min_happiness + - min_level + - needs_overworld_rain + - party_species + - party_type + - relative_physical_stats + - time_of_day + - trade_species + - trigger + - turn_upside_down + properties: + gender: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + examples: + - 1 + url: + type: string + format: uri + examples: + - 2 + held_item: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + examples: + - 1 + url: + type: string + format: uri + examples: + - 2 + item: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + examples: + - 1 + url: + type: string + format: uri + examples: + - 2 + known_move: + type: '' + nullable: true + known_move_type: + type: '' + nullable: true + location: + type: object + nullable: true + required: + - name + - url + properties: + name: + type: string + url: + type: string + format: uri + min_affection: + type: integer + format: int32 + nullable: true + min_beauty: + type: integer + format: int32 + nullable: true + min_happiness: + type: integer + format: int32 + nullable: true + min_level: + type: integer + format: int32 + nullable: true + needs_overworld_rain: + type: boolean + nullable: true + party_species: + type: string + nullable: true + party_type: + type: string + nullable: true + relative_physical_stats: + type: string + nullable: true + time_of_day: + type: string + trade_species: + type: string + nullable: true + trigger: + type: object + required: + - name + - url + properties: + name: + type: string + url: + type: string + format: uri + turn_upside_down: + type: boolean + is_baby: + type: boolean + species: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - happiny + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon-species/440/ + is_baby: + type: boolean + species: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - happiny + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon-species/440/ + readOnly: true + required: + - baby_trigger_item + - chain + - id + EvolutionChainSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + EvolutionTriggerDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/EvolutionTriggerName' + readOnly: true + pokemon_species: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - ivysaur + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon-species/2/ + readOnly: true + required: + - id + - name + - names + - pokemon_species + EvolutionTriggerName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + EvolutionTriggerSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + Experience: + type: object + properties: + level: + type: integer + maximum: 2147483647 + minimum: -2147483648 + experience: + type: integer + maximum: 2147483647 + minimum: -2147483648 + required: + - experience + - level + GenderDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + pokemon_species_details: + type: array + items: + type: object + required: + - rate + - pokemon_species + properties: + rate: + type: integer + format: int32 + examples: + - 1 + pokemon_species: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bulbasaur + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ + readOnly: true + required_for_evolution: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - wormadam + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon-species/413/ + readOnly: true + required: + - id + - name + - pokemon_species_details + - required_for_evolution + GenderSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + GenerationDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + abilities: + type: array + items: + $ref: '#/components/schemas/AbilitySummary' + readOnly: true + main_region: + $ref: '#/components/schemas/RegionSummary' + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/GenerationName' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + types: + type: array + items: + $ref: '#/components/schemas/TypeSummary' + readOnly: true + version_groups: + type: array + items: + $ref: '#/components/schemas/VersionGroupSummary' + readOnly: true + required: + - abilities + - id + - main_region + - moves + - name + - names + - pokemon_species + - types + - version_groups + GenerationName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + GenerationSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + GrowthRateDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + GrowthRateDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + formula: + type: string + maxLength: 500 + descriptions: + type: array + items: + $ref: '#/components/schemas/GrowthRateDescription' + readOnly: true + levels: + type: array + items: + $ref: '#/components/schemas/Experience' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - descriptions + - formula + - id + - levels + - name + - pokemon_species + GrowthRateSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemAttributeDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + ItemAttributeDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/ItemAttributeDescription' + readOnly: true + items: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - master-ball + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/item/1/ + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemAttributeName' + readOnly: true + required: + - descriptions + - id + - items + - name + - names + ItemAttributeName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemAttributeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemCategoryDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + items: + type: array + items: + $ref: '#/components/schemas/ItemSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemCategoryName' + readOnly: true + pocket: + $ref: '#/components/schemas/ItemPocketSummary' + required: + - id + - items + - name + - names + - pocket + ItemCategoryName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemCategorySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + cost: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + fling_power: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + fling_effect: + $ref: '#/components/schemas/ItemFlingEffectSummary' + attributes: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - countable + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/item-attribute/1/ + readOnly: true + category: + $ref: '#/components/schemas/ItemCategorySummary' + effect_entries: + type: array + items: + $ref: '#/components/schemas/ItemEffectText' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/ItemFlavorText' + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/ItemGameIndex' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemName' + readOnly: true + held_by_pokemon: + type: array + items: + type: object + required: + - pokemon + - version-details + properties: + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - farfetchd + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon/83/ + version-details: + type: array + items: + type: object + required: + - rarity + - version + properties: + rarity: + type: integer + format: int32 + examples: + - 5 + version: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - ruby + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version/7/ + readOnly: true + sprites: + type: object + required: + - default + properties: + default: + type: string + format: uri + examples: + - https://pokeapi.co/media/sprites/items/master-ball.png + readOnly: true + baby_trigger_for: + type: object + required: + - url + properties: + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/evolution-chain/51/ + readOnly: true + machines: + type: array + items: + type: object + required: + - machine + - version_group + properties: + machine: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/machine/1/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - sword-shield + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version-group/20/ + readOnly: true + required: + - attributes + - baby_trigger_for + - category + - effect_entries + - flavor_text_entries + - fling_effect + - game_indices + - held_by_pokemon + - id + - machines + - name + - names + - sprites + ItemEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + short_effect: + type: string + maxLength: 300 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + - short_effect + ItemFlavorText: + type: object + properties: + text: + type: string + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - text + - version_group + ItemFlingEffectDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + effect_entries: + type: array + items: + $ref: '#/components/schemas/ItemFlingEffectEffectText' + readOnly: true + items: + type: array + items: + $ref: '#/components/schemas/ItemSummary' + readOnly: true + required: + - effect_entries + - id + - items + - name + ItemFlingEffectEffectText: + type: object + properties: + effect: + type: string + maxLength: 6000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - effect + - language + ItemFlingEffectSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + required: + - game_index + - generation + ItemName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemPocketDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + categories: + type: array + items: + $ref: '#/components/schemas/ItemCategorySummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/ItemPocketName' + readOnly: true + required: + - categories + - id + - name + - names + ItemPocketName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + ItemPocketSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + ItemSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + LanguageDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + official: + type: boolean + iso639: + type: string + maxLength: 10 + iso3166: + type: string + maxLength: 2 + names: + type: array + items: + $ref: '#/components/schemas/LanguageName' + readOnly: true + required: + - id + - iso3166 + - iso639 + - name + - names + LanguageName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + LanguageSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + LocationAreaDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + encounter_method_rates: + type: array + items: + type: object + required: + - encounter_method + - version_details + properties: + encounter_method: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - old-rod + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/encounter-method/2/ + version_details: + type: array + items: + type: object + required: + - rate + - version + properties: + rate: + type: integer + format: int32 + examples: + - 5 + version: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - platinum + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version/14/ + readOnly: true + location: + $ref: '#/components/schemas/LocationSummary' + names: + type: array + items: + $ref: '#/components/schemas/LocationAreaName' + readOnly: true + pokemon_encounters: + type: array + items: + type: object + required: + - pokemon + - version_details + properties: + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - tentacool + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon/72/ + version_details: + type: array + items: + type: object + required: + - version + - max_chance + - encounter_details + properties: + version: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - diamond + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version/12/ + max_chance: + type: integer + format: int32 + examples: + - 60 + encounter_details: + type: object + required: + - min_level + - max_level + - condition_value + - chance + - method + properties: + min_level: + type: integer + format: int32 + examples: + - 20 + max_level: + type: integer + format: int32 + examples: + - 30 + condition_values: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - slot2-sapphire + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/encounter-condition-value/10/ + chance: + type: integer + format: int32 + examples: + - 60 + method: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - surf + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/encounter-method/5/ + readOnly: true + required: + - encounter_method_rates + - game_index + - id + - location + - name + - names + - pokemon_encounters + LocationAreaName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + LocationAreaSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + LocationDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + region: + $ref: '#/components/schemas/RegionSummary' + names: + type: array + items: + $ref: '#/components/schemas/LocationName' + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/LocationGameIndex' + readOnly: true + areas: + type: array + items: + $ref: '#/components/schemas/LocationAreaSummary' + readOnly: true + required: + - areas + - game_indices + - id + - name + - names + - region + LocationGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + required: + - game_index + - generation + LocationName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + LocationSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MachineDetail: + type: object + properties: + id: + type: integer + readOnly: true + item: + $ref: '#/components/schemas/ItemSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + move: + $ref: '#/components/schemas/MoveSummary' + required: + - id + - item + - move + - version_group + MachineSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + MoveBattleStyleDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/MoveBattleStyleName' + readOnly: true + required: + - id + - name + - names + MoveBattleStyleName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveBattleStyleSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveChange: + type: object + properties: + accuracy: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + power: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + pp: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + effect_chance: + type: integer + effect_entries: + type: array + items: + type: object + required: + - effect + - short_effect + - language + properties: + effect: + type: string + examples: + - Inflicts [regular damage]{mechanic:regular-damage}. + short_effect: + type: string + examples: + - Inflicts regular damage with no additional effect. + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + readOnly: true + type: + $ref: '#/components/schemas/TypeSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - effect_chance + - effect_entries + - type + - version_group + MoveDamageClassDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveDamageClassDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveDamageClassDescription' + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveDamageClassName' + readOnly: true + required: + - descriptions + - id + - moves + - name + - names + MoveDamageClassName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveDamageClassSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + accuracy: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + effect_chance: + type: integer + pp: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + priority: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + power: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + contest_combos: + type: object + required: + - normal + - super + properties: + normal: + type: object + required: + - use_before + - use_after + properties: + use_before: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - fire-punch + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/7/ + use_after: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - ice-punch + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/8/ + super: + type: object + required: + - use_before + - use_after + properties: + use_before: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - night-slash + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/400/ + use_after: + type: array + nullable: true + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - focus-energy + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/116/ + readOnly: true + contest_type: + $ref: '#/components/schemas/ContestTypeSummary' + contest_effect: + $ref: '#/components/schemas/ContestEffectSummary' + damage_class: + $ref: '#/components/schemas/MoveDamageClassSummary' + effect_entries: + type: array + items: + type: object + required: + - effect + - short_effect + - language + properties: + effect: + type: string + examples: + - Inflicts [regular damage]{mechanic:regular-damage}. + short_effect: + type: string + examples: + - Inflicts regular damage with no additional effect. + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + readOnly: true + effect_changes: + type: array + items: + type: object + required: + - effect_entries + - version_group + properties: + effect_entries: + type: array + items: + type: object + required: + - effect + - language + properties: + effect: + type: string + examples: + - Hits Pokémon under the effects of dig and fly. + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - gold-silver + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version-group/3/ + readOnly: true + generation: + $ref: '#/components/schemas/GenerationSummary' + meta: + allOf: + - $ref: '#/components/schemas/MoveMeta' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveName' + readOnly: true + past_values: + type: array + items: + $ref: '#/components/schemas/MoveChange' + readOnly: true + stat_changes: + type: array + items: + type: object + required: + - change + - stat + properties: + change: + type: integer + format: int32 + examples: + - 2 + stat: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - attack + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/stat/1/ + readOnly: true + super_contest_effect: + $ref: '#/components/schemas/SuperContestEffectSummary' + target: + $ref: '#/components/schemas/MoveTargetSummary' + type: + $ref: '#/components/schemas/TypeSummary' + machines: + type: array + items: + type: object + required: + - machine + - version_group + properties: + machine: + type: object + required: + - url + properties: + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/machine/1/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - sword-shield + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version-group/1/ + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/MoveFlavorText' + readOnly: true + learned_by_pokemon: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - clefairy + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon/35/ + readOnly: true + required: + - contest_combos + - contest_effect + - contest_type + - damage_class + - effect_chance + - effect_changes + - effect_entries + - flavor_text_entries + - generation + - id + - learned_by_pokemon + - machines + - meta + - name + - names + - past_values + - stat_changes + - super_contest_effect + - target + - type + MoveFlavorText: + type: object + properties: + flavor_text: + type: string + language: + $ref: '#/components/schemas/LanguageSummary' + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - flavor_text + - language + - version_group + MoveLearnMethodDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveLearnMethodDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/MoveLearnMethodName' + readOnly: true + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveLearnMethodDescription' + readOnly: true + version_groups: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - red-blue + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version-group/1/ + readOnly: true + required: + - descriptions + - id + - name + - names + - version_groups + MoveLearnMethodName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveLearnMethodSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveMeta: + type: object + properties: + ailment: + $ref: '#/components/schemas/MoveMetaAilmentSummary' + category: + $ref: '#/components/schemas/MoveMetaCategorySummary' + min_hits: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + max_hits: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + min_turns: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + max_turns: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + drain: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + healing: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + crit_rate: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + ailment_chance: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + flinch_chance: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + stat_chance: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + required: + - ailment + - category + MoveMetaAilmentDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + moves: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - thunder-punch + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/9/ + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveMetaAilmentName' + readOnly: true + required: + - id + - moves + - name + - names + MoveMetaAilmentName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveMetaAilmentSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveMetaCategoryDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveMetaCategoryDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveMetaCategoryDescription' + readOnly: true + moves: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - sing + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/47/ + readOnly: true + required: + - descriptions + - id + - moves + - name + MoveMetaCategorySummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + MoveTargetDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + MoveTargetDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + descriptions: + type: array + items: + $ref: '#/components/schemas/MoveTargetDescription' + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/MoveTargetName' + readOnly: true + required: + - descriptions + - id + - moves + - name + - names + MoveTargetName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + MoveTargetSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + NatureBattleStylePreference: + type: object + properties: + low_hp_preference: + type: integer + maximum: 2147483647 + minimum: -2147483648 + high_hp_preference: + type: integer + maximum: 2147483647 + minimum: -2147483648 + move_battle_style: + $ref: '#/components/schemas/MoveBattleStyleSummary' + required: + - high_hp_preference + - low_hp_preference + - move_battle_style + NatureDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + decreased_stat: + $ref: '#/components/schemas/StatSummary' + increased_stat: + $ref: '#/components/schemas/StatSummary' + likes_flavor: + $ref: '#/components/schemas/BerryFlavorSummary' + hates_flavor: + $ref: '#/components/schemas/BerryFlavorSummary' + berries: + type: array + items: + $ref: '#/components/schemas/BerrySummary' + readOnly: true + pokeathlon_stat_changes: + type: array + items: + type: object + required: + - max_change + - pokeathlon_stat + properties: + max_change: + type: integer + format: int32 + examples: + - 1 + pokeathlon_stat: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - power + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokeathlon-stat/2/ + readOnly: true + move_battle_style_preferences: + type: array + items: + $ref: '#/components/schemas/NatureBattleStylePreference' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/NatureName' + readOnly: true + required: + - berries + - decreased_stat + - hates_flavor + - id + - increased_stat + - likes_flavor + - move_battle_style_preferences + - name + - names + - pokeathlon_stat_changes + NatureName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + NatureSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PaginatedAbilitySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/AbilitySummary' + PaginatedBerryFirmnessSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/BerryFirmnessSummary' + PaginatedBerryFlavorSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/BerryFlavorSummary' + PaginatedBerrySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/BerrySummary' + PaginatedCharacteristicSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/CharacteristicSummary' + PaginatedContestEffectSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ContestEffectSummary' + PaginatedContestTypeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ContestTypeSummary' + PaginatedEggGroupSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EggGroupSummary' + PaginatedEncounterConditionSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EncounterConditionSummary' + PaginatedEncounterConditionValueSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EncounterConditionValueSummary' + PaginatedEncounterMethodSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EncounterMethodSummary' + PaginatedEvolutionChainSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EvolutionChainSummary' + PaginatedEvolutionTriggerSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/EvolutionTriggerSummary' + PaginatedGenderSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/GenderSummary' + PaginatedGenerationSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/GenerationSummary' + PaginatedGrowthRateSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/GrowthRateSummary' + PaginatedItemAttributeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemAttributeSummary' + PaginatedItemCategorySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemCategorySummary' + PaginatedItemFlingEffectSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemFlingEffectSummary' + PaginatedItemPocketSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemPocketSummary' + PaginatedItemSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/ItemSummary' + PaginatedLanguageSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LanguageSummary' + PaginatedLocationAreaSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LocationAreaSummary' + PaginatedLocationSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/LocationSummary' + PaginatedMachineSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MachineSummary' + PaginatedMoveBattleStyleSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveBattleStyleSummary' + PaginatedMoveDamageClassSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveDamageClassSummary' + PaginatedMoveLearnMethodSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveLearnMethodSummary' + PaginatedMoveMetaAilmentSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveMetaAilmentSummary' + PaginatedMoveMetaCategorySummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveMetaCategorySummary' + PaginatedMoveSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + PaginatedMoveTargetSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/MoveTargetSummary' + PaginatedNatureSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/NatureSummary' + PaginatedPalParkAreaSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PalParkAreaSummary' + PaginatedPokeathlonStatSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokeathlonStatSummary' + PaginatedPokedexSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokedexSummary' + PaginatedPokemonColorSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonColorSummary' + PaginatedPokemonFormSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonFormSummary' + PaginatedPokemonHabitatSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonHabitatSummary' + PaginatedPokemonShapeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonShapeSummary' + PaginatedPokemonSpeciesSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + PaginatedPokemonSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/PokemonSummary' + PaginatedRegionSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/RegionSummary' + PaginatedStatSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/StatSummary' + PaginatedSuperContestEffectSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/SuperContestEffectSummary' + PaginatedTypeSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/TypeSummary' + PaginatedVersionGroupSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/VersionGroupSummary' + PaginatedVersionSummaryList: + type: object + properties: + count: + type: integer + example: 123 + next: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=400&limit=100 + previous: + type: string + nullable: true + format: uri + example: http://api.example.org/accounts/?offset=200&limit=100 + results: + type: array + items: + $ref: '#/components/schemas/VersionSummary' + PalParkAreaDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/PalParkAreaName' + readOnly: true + pokemon_encounters: + type: array + items: + type: object + required: + - base_score + - pokemon-species + - rate + properties: + base_score: + type: integer + format: int32 + examples: + - 50 + pokemon-species: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bulbasaur + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ + rate: + type: integer + format: int32 + examples: + - 30 + readOnly: true + required: + - id + - name + - names + - pokemon_encounters + PalParkAreaName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PalParkAreaSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokeathlonStatDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + affecting_natures: + type: object + required: + - decrease + - increase + properties: + decrease: + type: array + items: + type: object + required: + - max_change + - nature + properties: + max_change: + type: integer + format: int32 + maximum: -1 + examples: + - -1 + nature: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - hardy + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/nature/1/ + increase: + type: array + items: + type: object + required: + - max_change + - nature + properties: + max_change: + type: integer + format: int32 + minimum: 1 + examples: + - 2 + nature: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - hardy + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/nature/1/ + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/PokeathlonStatName' + readOnly: true + required: + - affecting_natures + - id + - name + - names + PokeathlonStatName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokeathlonStatSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokedexDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + PokedexDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + is_main_series: + type: boolean + descriptions: + type: array + items: + $ref: '#/components/schemas/PokedexDescription' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/PokedexName' + readOnly: true + pokemon_entries: + type: array + items: + type: object + required: + - entry_number + - pokemon_species + properties: + entry_number: + type: integer + format: int32 + examples: + - 1 + pokemon_species: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bulbasaur + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon-species/1/ + readOnly: true + region: + $ref: '#/components/schemas/RegionSummary' + version_groups: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - the-teal-mask + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version-group/26/ + readOnly: true + required: + - descriptions + - id + - name + - names + - pokemon_entries + - region + - version_groups + PokedexName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokedexSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonColorDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/PokemonColorName' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - id + - name + - names + - pokemon_species + PokemonColorName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokemonColorSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + base_experience: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + height: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + is_default: + type: boolean + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + weight: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + abilities: + type: array + items: + type: object + required: + - ability + - is_hidden + - slot + properties: + ability: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - sand-veil + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/ability/8/ + is_hidden: + type: boolean + slot: + type: integer + format: int32 + examples: + - 1 + readOnly: true + past_abilities: + type: array + items: + type: object + required: + - abilities + - generation + properties: + abilities: + type: array + items: + type: object + required: + - ability + - is_hidden + - slot + properties: + ability: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - levitate + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/ability/26/ + is_hidden: + type: boolean + slot: + type: integer + format: int32 + examples: + - 1 + generation: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - generation-vi + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/generation/6/ + readOnly: true + forms: + type: array + items: + $ref: '#/components/schemas/PokemonFormSummary' + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/PokemonGameIndex' + readOnly: true + held_items: + type: object + required: + - item + - version_details + properties: + item: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - soft-sand + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/item/214/ + version_details: + type: array + items: + type: object + required: + - rarity + - version + properties: + rarity: + type: integer + format: int32 + examples: + - 5 + version: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - diamond + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version/12/ + readOnly: true + location_area_encounters: + type: string + examples: + - https://pokeapi.co/api/v2/pokemon/1/encounters + readOnly: true + moves: + type: array + items: + type: object + required: + - move + - version_group_details + properties: + move: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - scratch + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/10/ + version_group_details: + type: array + items: + type: object + required: + - level_learned_at + - move_learn_method + - version_group + properties: + level_learned_at: + type: integer + format: int32 + examples: + - 1 + move_learn_method: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - level-up + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move-learn-method/1/ + version_group: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - red-blue + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version-group/1/ + readOnly: true + species: + $ref: '#/components/schemas/PokemonSpeciesSummary' + sprites: + type: object + properties: + front_default: + type: string + format: uri + exmaple: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png + additionalProperties: + type: string + format: uri + nullable: true + examples: + - https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png + examples: + - back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png + back_female: null + back_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png + back_shiny_female: null + front_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png + front_female: null + front_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png + front_shiny_female: null + readOnly: true + cries: + type: object + required: + - latest + - legacy + properties: + latest: + type: string + format: uri + examples: + - https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg + legacy: + type: string + format: uri + examples: + - https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg + readOnly: true + stats: + type: array + items: + $ref: '#/components/schemas/PokemonStat' + readOnly: true + types: + type: array + items: + type: object + required: + - slot + - type + properties: + slot: + type: integer + format: int32 + examples: + - 1 + type: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - ghost + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/8/ + readOnly: true + past_types: + type: array + items: + type: object + required: + - generation + - types + properties: + generation: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - generation-v + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/generation/5/ + types: + type: array + items: + type: object + required: + - slot + - type + properties: + slot: + type: integer + format: int32 + examples: + - 1 + type: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - normal + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/1/ + readOnly: true + required: + - abilities + - cries + - forms + - game_indices + - held_items + - id + - location_area_encounters + - moves + - name + - past_abilities + - past_types + - species + - sprites + - stats + - types + PokemonDexEntry: + type: object + properties: + entry_number: + type: integer + pokedex: + $ref: '#/components/schemas/PokedexSummary' + required: + - entry_number + - pokedex + PokemonFormDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + form_order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + is_default: + type: boolean + is_battle_only: + type: boolean + is_mega: + type: boolean + form_name: + type: string + maxLength: 30 + pokemon: + $ref: '#/components/schemas/PokemonSummary' + sprites: + type: object + properties: + default: + type: string + format: uri + examples: + - https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png + additionalProperties: + type: string + format: uri + nullable: true + examples: + - https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png + examples: + - back_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png + back_female: null + back_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png + back_shiny_female: null + front_default: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png + front_female: null + front_shiny: https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png + front_shiny_female: null + readOnly: true + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + form_names: + type: array + items: + type: object + required: + - language + - name + properties: + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + name: + type: string + examples: + - Plant Cloak + readOnly: true + names: + type: array + items: + type: object + required: + - language + - name + properties: + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + name: + type: string + examples: + - Plant Cloak + readOnly: true + types: + type: array + items: + type: object + required: + - slot + - type + properties: + slot: + type: integer + format: int32 + examples: + - 1 + type: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bug + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/7/ + readOnly: true + required: + - form_name + - form_names + - id + - name + - names + - pokemon + - sprites + - types + - version_group + PokemonFormSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + version: + $ref: '#/components/schemas/VersionSummary' + required: + - game_index + - version + PokemonHabitatDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/PokemonHabitatName' + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - id + - name + - names + - pokemon_species + PokemonHabitatName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + PokemonHabitatSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonShapeDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + awesome_names: + type: array + items: + type: object + required: + - awesome_name + - language + properties: + awesome_name: + type: string + examples: + - Pomaceous + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + readOnly: true + names: + type: array + items: + type: object + required: + - url + - name + properties: + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + name: + type: string + examples: + - Ball + readOnly: true + pokemon_species: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesSummary' + readOnly: true + required: + - awesome_names + - id + - name + - names + - pokemon_species + PokemonShapeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonSpeciesDescription: + type: object + properties: + description: + type: string + maxLength: 1000 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + PokemonSpeciesDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + gender_rate: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + capture_rate: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + base_happiness: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + is_baby: + type: boolean + is_legendary: + type: boolean + is_mythical: + type: boolean + hatch_counter: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + has_gender_differences: + type: boolean + forms_switchable: + type: boolean + growth_rate: + $ref: '#/components/schemas/GrowthRateSummary' + pokedex_numbers: + type: array + items: + $ref: '#/components/schemas/PokemonDexEntry' + readOnly: true + egg_groups: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - monster + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/egg-group/1/ + readOnly: true + color: + $ref: '#/components/schemas/PokemonColorSummary' + shape: + $ref: '#/components/schemas/PokemonShapeSummary' + evolves_from_species: + $ref: '#/components/schemas/PokemonSpeciesSummary' + evolution_chain: + $ref: '#/components/schemas/EvolutionChainSummary' + habitat: + $ref: '#/components/schemas/PokemonHabitatSummary' + generation: + $ref: '#/components/schemas/GenerationSummary' + names: + type: array + items: + type: object + required: + - language + - name + properties: + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + name: + type: string + examples: + - bulbasaur + readOnly: true + pal_park_encounters: + type: array + items: + type: object + required: + - area + - base_score + - rate + properties: + area: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - field + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pal-park-area/2/ + base_score: + type: integer + format: int32 + examples: + - 50 + rate: + type: integer + format: int32 + examples: + - 30 + readOnly: true + form_descriptions: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesDescription' + readOnly: true + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/PokemonSpeciesFlavorText' + readOnly: true + genera: + type: array + items: + type: object + required: + - genus + - language + properties: + genus: + type: string + examples: + - Seed Pokémon + language: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - en + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/language/9/ + readOnly: true + varieties: + type: array + items: + type: object + required: + - is_default + - pokemon + properties: + is_default: + type: boolean + pokemon: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bulbasaur + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokemon/1/ + readOnly: true + required: + - color + - egg_groups + - evolution_chain + - evolves_from_species + - flavor_text_entries + - form_descriptions + - genera + - generation + - growth_rate + - habitat + - id + - name + - names + - pal_park_encounters + - pokedex_numbers + - shape + - varieties + PokemonSpeciesFlavorText: + type: object + properties: + flavor_text: + type: string + language: + $ref: '#/components/schemas/LanguageSummary' + version: + $ref: '#/components/schemas/VersionSummary' + required: + - flavor_text + - language + - version + PokemonSpeciesSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + PokemonStat: + type: object + properties: + base_stat: + type: integer + maximum: 2147483647 + minimum: -2147483648 + effort: + type: integer + maximum: 2147483647 + minimum: -2147483648 + stat: + $ref: '#/components/schemas/StatSummary' + required: + - base_stat + - effort + - stat + PokemonSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + RegionDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + locations: + type: array + items: + $ref: '#/components/schemas/LocationSummary' + readOnly: true + main_generation: + allOf: + - $ref: '#/components/schemas/GenerationSummary' + readOnly: true + names: + type: array + items: + $ref: '#/components/schemas/RegionName' + readOnly: true + pokedexes: + type: array + items: + $ref: '#/components/schemas/PokedexSummary' + readOnly: true + version_groups: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - red-blue + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/version-group/1/ + readOnly: true + required: + - id + - locations + - main_generation + - name + - names + - pokedexes + - version_groups + RegionName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + RegionSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + StatDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + is_battle_only: + type: boolean + affecting_moves: + type: object + required: + - decrease + - increase + properties: + increase: + type: array + items: + type: object + required: + - change + - move + properties: + change: + type: integer + format: int32 + examples: + - -1 + move: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - swords-dance + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/14/ + decrease: + type: array + items: + type: object + required: + - change + - move + properties: + change: + type: integer + format: int32 + examples: + - 5 + move: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - growl + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move/45/ + readOnly: true + affecting_natures: + type: object + required: + - increase + - decrease + properties: + increase: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - lonely + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/nature/6/ + decrease: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bold + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/nature/2/ + readOnly: true + characteristics: + type: array + items: + $ref: '#/components/schemas/CharacteristicSummary' + readOnly: true + move_damage_class: + $ref: '#/components/schemas/MoveDamageClassSummary' + names: + type: array + items: + $ref: '#/components/schemas/StatName' + readOnly: true + required: + - affecting_moves + - affecting_natures + - characteristics + - game_index + - id + - move_damage_class + - name + - names + StatName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + StatSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + SuperContestEffectDetail: + type: object + properties: + id: + type: integer + readOnly: true + appeal: + type: integer + maximum: 2147483647 + minimum: -2147483648 + flavor_text_entries: + type: array + items: + $ref: '#/components/schemas/SuperContestEffectFlavorText' + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + required: + - appeal + - flavor_text_entries + - id + - moves + SuperContestEffectFlavorText: + type: object + properties: + flavor_text: + type: string + maxLength: 500 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - flavor_text + - language + SuperContestEffectSummary: + type: object + properties: + url: + type: string + format: uri + readOnly: true + required: + - url + TypeDetail: + type: object + description: Serializer for the Type resource + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + damage_relations: + type: object + required: + - no_damage_to + - half_damage_to + - double_damage_to + - no_damage_from + - half_damage_from + - double_damage_from + properties: + no_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - flying + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/3/ + half_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bug + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/7/ + double_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - poison + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/4/ + no_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - electric + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/13/ + half_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - poison + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/4/ + double_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - water + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/11/ + readOnly: true + past_damage_relations: + type: array + items: + type: object + required: + - generation + - damage_relations + properties: + generation: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - generation-v + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/generation/5/ + damage_relations: + type: object + required: + - no_damage_to + - half_damage_to + - double_damage_to + - no_damage_from + - half_damage_from + - double_damage_from + properties: + no_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - flying + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/3/ + half_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - bug + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/7/ + double_damage_to: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - poison + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/4/ + no_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - electric + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/13/ + half_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - poison + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/4/ + double_damage_from: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - water + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/type/11/ + readOnly: true + game_indices: + type: array + items: + $ref: '#/components/schemas/TypeGameIndex' + readOnly: true + generation: + $ref: '#/components/schemas/GenerationSummary' + move_damage_class: + $ref: '#/components/schemas/MoveDamageClassSummary' + names: + type: array + items: + $ref: '#/components/schemas/AbilityName' + readOnly: true + pokemon: + type: array + items: + type: object + required: + - potency + - flavor + properties: + slot: + type: integer + examples: + - 1 + pokemon: + type: object + require: + - name + - url + properties: + name: + type: string + description: The name of the pokemon + examples: + - sandshrew + url: + type: string + format: uri + description: The URL to get more information about the pokemon + examples: + - https://pokeapi.co/api/v2/pokemon/27/ + readOnly: true + moves: + type: array + items: + $ref: '#/components/schemas/MoveSummary' + readOnly: true + required: + - damage_relations + - game_indices + - generation + - id + - move_damage_class + - moves + - name + - names + - past_damage_relations + - pokemon + TypeGameIndex: + type: object + properties: + game_index: + type: integer + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + required: + - game_index + - generation + TypeSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + VersionDetail: + type: object + description: |- + Should have a link to Version Group info but the Circular + dependency and compilation order fight eachother and I'm + not sure how to add anything other than a hyperlink + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + names: + type: array + items: + $ref: '#/components/schemas/VersionName' + readOnly: true + version_group: + $ref: '#/components/schemas/VersionGroupSummary' + required: + - id + - name + - names + - version_group + VersionGroupDetail: + type: object + properties: + id: + type: integer + readOnly: true + name: + type: string + maxLength: 100 + order: + type: + - integer + - 'null' + maximum: 2147483647 + minimum: -2147483648 + generation: + $ref: '#/components/schemas/GenerationSummary' + move_learn_methods: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - level-up + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/move-learn-method/1/ + readOnly: true + pokedexes: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - kanto + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/pokedex/2/ + readOnly: true + regions: + type: array + items: + type: object + required: + - name + - url + properties: + name: + type: string + examples: + - kanto + url: + type: string + format: uri + examples: + - https://pokeapi.co/api/v2/region/1/ + readOnly: true + versions: + type: array + items: + $ref: '#/components/schemas/VersionSummary' + readOnly: true + required: + - generation + - id + - move_learn_methods + - name + - pokedexes + - regions + - versions + VersionGroupSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + VersionName: + type: object + properties: + name: + type: string + maxLength: 100 + language: + $ref: '#/components/schemas/LanguageSummary' + required: + - language + - name + VersionSummary: + type: object + properties: + name: + type: string + maxLength: 100 + url: + type: string + format: uri + readOnly: true + required: + - name + - url + securitySchemes: + basicAuth: + type: http + scheme: basic + cookieAuth: + type: apiKey + in: cookie + name: sessionid +servers: +- url: https://pokeapi.co +tags: +- pokemon +- evolution +- berries +- items +- machines +- location +- contest +- moves +- encounters +- games +- utility +externalDocs: + url: https://pokeapi.co/docs/v2 diff --git a/pokemon_v2/README.md b/pokemon_v2/README.md index aacb4cbaa..3bc00d0e4 100644 --- a/pokemon_v2/README.md +++ b/pokemon_v2/README.md @@ -1,3182 +1 @@ - -# Pokeapi V2 API Reference - - - - - - - - - - - - -
API Endpoints
- - - - - -
- -## Resource Lists -Calling any api endpoint without a resource id or name will return a paginated list of available resources for that api. By default, a list 'page' will contain up to 20 resources. If you would like to change this just add a 'limit' query param, e.g. `limit=60`. - -### GET api/v2/{endpoint} - -###### example response for non-named resources - -```json -{ - "count": 365, - "next": "http://pokeapi.co/api/v2/evolution-chain/?limit=20&offset=20", - "previous": null, - "results": [{ - "url": "http://pokeapi.co/api/v2/evolution-chain/1/" - }] -} -``` - -#### APIResourceList - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| count | The total number of resources available from this api | integer | -| next | The url for the next 'page' in the list | string | -| previous | The url for the previous page in the list | boolean | -| results | The list of non-named api resources | list [APIResource](#apiresource) | - - -###### example response for named resources - -```json -{ - "count": 248, - "next": "http://pokeapi.co/api/v2/ability/?limit=20&offset=20", - "previous": null, - "results": [{ - "name": "stench", - "url": "http://pokeapi.co/api/v2/ability/1/" - }] -} -``` - -#### NamedAPIResourceList - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| count | The total number of resources available from this api | integer | -| next | The url for the next 'page' in the list | string | -| previous | The url for the previous page in the list | boolean | -| results | The list of named api resources | list [NamedAPIResource](#namedapiresource) | - - - -

Berries

- -## Berries -Berries are small fruits that can provide HP and status condition restoration, stat enhancement, and even damage negation when eaten by pokemon. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail. - -### GET api/v2/berry/{id or name} - -###### example response - -```json -{ - "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": "http://pokeapi.co/api/v2/berry-firmness/2/" - }, - "flavors": [{ - "potency": 10, - "flavor": { - "name": "spicy", - "url": "http://pokeapi.co/api/v2/berry-flavor/1/" - } - }], - "item": { - "name": "cheri-berry", - "url": "http://pokeapi.co/api/v2/item/126/" - }, - "natural_gift_type": { - "name": "fire", - "url": "http://pokeapi.co/api/v2/type/10/" - } -} - -``` - -###### response models - -#### Berry - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this berry resource | integer | -| name | The name for this berry resource | string | -| growth_time | 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. | integer | -| max_harvest | The maximum number of these berries that can grow on one tree in Generation IV | integer | -| natural_gift_power | The power of the move "Natural Gift" when used with this Berry | integer | -| size | The size of this Berry, in millimeters | integer | -| smoothness | The smoothness of this Berry, used in making Pokéblocks or Poffins | integer | -| soil_dryness | The speed at which this Berry dries out the soil as it grows. A higher rate means the soil dries more quickly. | integer | -| firmness | The firmness of this berry, used in making Pokéblocks or Poffins | [NamedAPIResource](#namedapiresource) ([BerryFirmness](#berry-firmnesses)) | -| flavors | A list of references to each flavor a berry can have and the potency of each of those flavors in regard to this berry | list [BerryFlavorMap](#berryflavormap) | -| item | Berries are actually items. This is a reference to the item specific data for this berry. | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| natural_gift_type | The Type the move "Natural Gift" has when used with this Berry | [NamedAPIResource](#namedapiresource) ([Type](#types)) | - -#### BerryFlavorMap - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| potency | How powerful the referenced flavor is for this berry | integer | -| flavor | The referenced berry flavor | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | - - -## Berry Firmnesses - -### GET api/v2/berry-firmness/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "very-soft", - "berries": [{ - "name": "pecha", - "url": "http://pokeapi.co/api/v2/berry/3/" - }], - "names": [{ - "name": "Very Soft", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### BerryFirmness - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this berry firmness resource | integer | -| name | The name for this berry firmness resource | string | -| berries | A list of the berries with this firmness | list [NamedAPIResource](#namedapiresource) ([Berry](#berries)) | -| names | The name of this berry firmness listed in different languages | list [Name](#resourcename) | - - - -## Berry Flavors -Flavors determine whether a pokemon will benefit or suffer from eating a berry based on their [nature](#natures). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail. - -### GET api/v2/berry-flavor/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "spicy", - "berries": [{ - "potency": 10, - "berry": { - "name": "rowap", - "url": "http://pokeapi.co/api/v2/berry/64/" - } - }], - "contest_type": { - "name": "cool", - "url": "http://pokeapi.co/api/v2/contest-type/1/" - }, - "names": [{ - "name": "Spicy", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### BerryFlavor - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this berry flavor resource | integer | -| name | The name for this berry flavor resource | string | -| berries | A list of the berries with this flavor | list [FlavorBerryMap](#flavorberrymap) | -| contest_type | The contest type that correlates with this berry flavor | [NamedAPIResource](#namedapiresource) ([ContestType](#contest-types)) | -| names | The name of this berry flavor listed in different languages | list [Name](#resourcename) | - -#### FlavorBerryMap - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| potency | How powerful the referenced flavor is for this berry | integer | -| berry | The berry with the referenced flavor | [NamedAPIResource](#namedapiresource) ([Berry](#berry)) | - - - -

Contests

- -## Contest Types -Contest types are categories judges used to weigh a pokémon's condition in pokemon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail. - -### GET api/v2/contest-type/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "cool", - "berry_flavor": { - "name": "spicy", - "url": "http://pokeapi.co/api/v2/berry-flavor/1/" - }, - "names": [{ - "name": "Cool", - "color": "Red", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### ContestType - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this contest type resource | integer | -| name | The name for this contest type resource | string | -| berry_flavor | The berry flavor that correlates with this contest type | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | -| names | The name of this contest type listed in different languages | list [Name](#resourcename) | - - - -## Contest Effects -Contest effects refer to the effects of moves when used in contests. - -### GET api/v2/contest-effect/{id} - -###### example response - -```json -{ - "id": 1, - "appeal": 4, - "jam": 0, - "effect_entries": [{ - "effect": "Gives a high number of appeal points wth no other effects.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "flavor_text_entries": [{ - "flavor_text": "A highly appealing move.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### ContestEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this contest type resource | integer | -| appeal | The base number of hearts the user of this move gets | string | -| jam | The base number of hearts the user's opponent loses | integer | -| effect_entries | The result of this contest effect listed in different languages | list [Effect](#effect) | -| flavor_text_entries | The flavor text of this contest effect listed in different languages | list [FlavorText](#flavortext) | - - -## Super Contest Effects -Super contest effects refer to the effects of moves when used in super contests. - -### GET api/v2/super-contest-effect/{id} - -###### example response - -```json -{ - "id": 1, - "appeal": 2, - "flavor_text_entries": [{ - "flavor_text": "Enables the user to perform first in the next turn.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "moves": [{ - "name": "agility", - "url": "http://pokeapi.co/api/v2/move/97/" - }] -} -``` - -###### response models - -#### SuperContestEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this super contest effect resource | integer | -| appeal | The level of appeal this super contest effect has | string | -| flavor_text_entries | The flavor text of this super contest effect listed in different languages | list [FlavorText](#flavortext) | -| moves | A list of moves that have the effect when used in super contests | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - - - -

Encounters

- -## Encounter Methods -Methods by which the player can encounter pokémon in the wild, e.g., walking in tall grass. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Wild_Pokémon) for greater detail. - -### GET api/v2/encounter-method/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "walk", - "order": 1, - "names": [{ - "name": "Walking in tall grass or a cave", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### EncounterMethod - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this encounter method resource | integer | -| name | The name for this encounter method resource | string | -| order | A good value for sorting | integer | -| names | The name of this encounter method listed in different languages | list [Name](#resourcename) | - - - -## Encounter Conditions -Conditions which affect what pokémon might appear in the wild, e.g., day or night. - -### GET api/v2/encounter-condition/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "swarm", - "values": [{ - "name": "swarm-yes", - "url": "http://pokeapi.co/api/v2/encounter-condition-value/1/" - }, { - "name": "swarm-no", - "url": "http://pokeapi.co/api/v2/encounter-condition-value/2/" - }], - "names": [{ - "name": "Schwarm", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }] -} - -``` - -###### response models - -#### EncounterCondition - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this encounter condition resource | integer | -| name | The name for this encounter condition resource | string | -| names | The name of this encounter method listed in different languages | list [Name](#resourcename) | -| values | A list of possible values for this encounter condition | list [NamedAPIResource](#namedapiresource) ([EncounterConditionValue](#encounter-condition-values)) | - - - -## Encounter Condition Values -Encounter condition values are the various states that an encounter condition can have, i.e., Time of day can be either day or night. - -### GET api/v2/encounter-condition-value/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "swarm-yes", - "condition": { - "name": "swarm", - "url": "http://pokeapi.co/api/v2/encounter-condition/1/" - }, - "names": [{ - "name": "Während eines Schwarms", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }] -} - -``` - -###### response models - -#### EncounterConditionValue - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this encounter condition value resource | integer | -| name | The name for this encounter condition value resource | string | -| condition | The condition this encounter condition value pertains to | list [NamedAPIResource](#namedapiresource) ([EncounterCondition](#encounter-conditions)) | -| names | The name of this encounter condition value listed in different languages | list [Name](#resourcename) | - - - -

Evolution

- -## Evolution Chains -Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as pokémon they can evolve into up through the hierarchy. - -### GET api/v2/evolution-chain/{id} - -###### example response - -```json -{ - "id": 7, - "baby_trigger_item": null, - "chain": { - "is_baby": false, - "species": { - "name": "rattata", - "url": "http://pokeapi.co/api/v2/pokemon-species/19/" - }, - "evolution_details": null, - "evolves_to": [{ - "is_baby": false, - "species": { - "name": "raticate", - "url": "http://pokeapi.co/api/v2/pokemon-species/20/" - }, - "evolution_details": { - "item": null, - "trigger": { - "name": "level-up", - "url": "http://pokeapi.co/api/v2/evolution-trigger/1/" - }, - "gender": null, - "held_item": null, - "known_move": null, - "known_move_type": null, - "location": null, - "min_level": 20, - "min_happiness": null, - "min_beauty": null, - "min_affection": null, - "needs_overworld_rain": false, - "party_species": null, - "party_type": null, - "relative_physical_stats": null, - "time_of_day": "", - "trade_species": null, - "turn_upside_down": false - }, - "evolves_to": [] - }] - } -} -``` - -###### response models - -#### EvolutionChain - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this evolution chain resource | integer | -| baby_trigger_item | The item that a pokémon would be holding when mating that would trigger the egg hatching a baby pokémon rather than a basic pokémon | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| chain | The base chain link object. Each link contains evolution details for a pokémon in the chain. Each link references the next pokémon in the natural evolution order. | [ChainLink](#chainlink) | - -#### ChainLink - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| is_baby | Whether or not this link is for a baby pokémon. This would only ever be true on the base link. | boolean | -| species | The pokemon species at this point in the evolution chain | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| evolution_details | All details regarding the specific details of the referenced pokémon species evolution | [EvolutionDetail](#evolutiondetail) | -| evolves_to | A List of chain objects. | list [ChainLink](#chainlink) | - -#### EvolutionDetail - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| item | The item required to cause evolution this into pokémon species | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| trigger | The type of event that triggers evolution into this pokémon species | [NamedAPIResource](#namedapiresource) ([EvolutionTrigger](#evolution-triggers)) | -| gender | The gender the evolving pokémon species must be in order to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Gender](#genders)) | -| held_item | The item the evolving pokémon species must be holding during the evolution trigger event to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| known_move | The move that must be known by the evolving pokémon species during the evolution trigger event in order to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| known_move_type | The evolving pokémon species must know a move with this type during the evolution trigger event in order to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| location | The location the evolution must be triggered at. | [NamedAPIResource](#namedapiresource) ([Location](#locations)) | -| min_level | The minimum required level of the evolving pokémon species to evolve into this pokémon species | integer | -| min_happiness | The minimum required level of happiness the evolving pokémon species to evolve into this pokémon species | integer | -| min_beauty | The minimum required level of beauty the evolving pokémon species to evolve into this pokémon species | integer | -| min_affection | The minimum required level of affection the evolving pokémon species to evolve into this pokémon species | integer | -| needs_overworld_rain | Whether or not it must be raining in the overworld to cause evolution this pokémon species | boolean | -| party_species | The pokémon species that must be in the players party in order for the evolving pokémon species to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| party_type | The player must have a pokémon of this type in their party during the evolution trigger event in order for the evolving pokémon species to evolve into this pokémon species | [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| relative_physical_stats | The required relation between the Pokémon's Attack and Defense stats. 1 means Attack > Defense. 0 means Attack = Defense. -1 means Attack < Defense. | integer | -| time_of_day | The required time of day. Day or night. | string | -| trade_species | Pokémon species for which this one must be traded. | [NamedAPIResource](#namedapiresource) ([Pokémon Species](#pokemon-species)) | -| turn_upside_down | Whether or not the 3DS needs to be turned upside-down as this Pokémon levels up. | boolean | - - -## Evolution Triggers -Evolution triggers are the events and conditions that cause a pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail. - -### GET api/v2/evolution-trigger/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "level-up", - "names": [{ - "name": "Level up", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pokemon_species": [{ - "name": "ivysaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/2/" - }] -} - -``` - -###### response models - -#### EvolutionTrigger - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this evolution trigger resource | integer | -| name | The name for this evolution trigger resource | string | -| names | The name of this evolution trigger listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of pokémon species that result from this evolution trigger | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - - -

Games

- -## Generations -A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released. - -### GET api/v2/generation/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "generation-i", - "abilities": [], - "main_region": { - "name": "kanto", - "url": "http://pokeapi.co/api/v2/region/1/" - }, - "moves": [{ - "name": "pound", - "url": "http://pokeapi.co/api/v2/move/1/" - }], - "names": [{ - "name": "Generation I", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "pokemon_species": [{ - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - }], - "types": [{ - "name": "normal", - "url": "http://pokeapi.co/api/v2/type/1/" - }], - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} - -``` - -###### response models - -#### Generation - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this generation resource | integer | -| name | The name for this generation resource | string | -| abilities | A list of abilities that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([Ability](#abilities)) | -| names | The name of this generation listed in different languages | list [Name](#resourcename) | -| main_region | The main region travelled in this generation | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| moves | A list of moves that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| pokemon_species | A list of pokémon species that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| types | A list of types that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| version_groups | A list of version groups that were introduced in this generation | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - - -## Pokedexes -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](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail. (Note: no official plural of 'pokédex' is known, 'standard' -(e)s is used here) - -### GET api/v2/pokedex/{id or name} - -###### example response - -```json -{ - "id": 2, - "name": "kanto", - "is_main_series": true, - "descriptions": [{ - "description": "Rot/Blau/Gelb Kanto Dex", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "names": [{ - "name": "Kanto", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "pokemon_entries": [{ - "entry_number": 1, - "pokemon_species": { - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - } - }], - "region": { - "name": "kanto", - "url": "http://pokeapi.co/api/v2/region/1/" - }, - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} -``` - -###### response models - -#### Pokedex - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokédex resource | integer | -| name | The name for this pokédex resource | string | -| is_main_series | Whether or not this pokédex originated in the main series of the video games | boolean | -| descriptions | The description of this pokédex listed in different languages | list [Description](#description) | -| names | The name of this pokédex listed in different languages | list [Name](#resourcename) | -| pokemon_entries | A list of pokémon catalogued in this pokédex and their indexes | list [PokemonEntry](#pokemonentry) | -| region | The region this pokédex catalogues pokémon for | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| version_groups | A list of version groups this pokédex is relevent to | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - -#### PokemonEntry - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| entry_number | The index of this pokémon species entry within the pokédex | integer | -| pokemon_species | The pokémon species being encountered | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - - -## Versions -Versions of the games, e.g., Red, Blue or Yellow. - -### GET api/v2/version/{id or name} - -###### example response - -```json - -{ - "id": 1, - "name": "red", - "names": [{ - "name": "Rot", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "version_group": { - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - } -} -``` - -###### response models - -#### Version - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this version resource | integer | -| name | The name for this version resource | string | -| names | The name of this version listed in different languages | list [Name](#resourcename) | -| version_group | The version group this version belongs to | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -## Version Groups -Version groups categorize highly similar versions of the games. - -### GET api/v2/version-group/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "red-blue", - "order": 1, - "generation": { - "name": "generation-i", - "url": "http://pokeapi.co/api/v2/generation/1/" - }, - "move_learn_methods": [{ - "name": "level-up", - "url": "http://pokeapi.co/api/v2/move-learn-method/1/" - }], - "pokedexes": [{ - "name": "kanto", - "url": "http://pokeapi.co/api/v2/pokedex/2/" - }], - "regions": [{ - "name": "kanto", - "url": "http://pokeapi.co/api/v2/region/1/" - }], - "versions": [{ - "name": "red", - "url": "http://pokeapi.co/api/v2/version/1/" - }] -} -``` - -###### response models - -#### VersionGroup - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this version group resource | integer | -| name | The name for this version group resource | string | -| order | Order for sorting. Almost by date of release, except similar versions are grouped together. | integer | -| generation | The generation this version was introduced in | list [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| move_learn_methods | A list of methods in which pokemon can learn moves in this version group | list [NamedAPIResource](#namedapiresource) ([MoveLearnMethod](#move-learn-methods)) | -| names | The name of this version group listed in different languages | list [Name](#resourcename) | -| pokedexes | A list of pokedexes introduces in this version group | list [NamedAPIResource](#namedapiresource) ([Pokedex](#pokedexes)) | -| regions | A list of regions that can be visited in this version group | list [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| versions | The versions this version group owns | list [NamedAPIResource](#namedapiresource) ([Version](#versions)) | - - -

Items

- -## Items -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. - -### GET api/v2/item/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "master-ball", - "cost": 0, - "fling_power": 10, - "fling_effect": { - "name":"flinch", - "url":"http://pokeapi.co/api/v2/item-fling-effect/7/" - }, - "attributes": [{ - "name": "holdable", - "url": "http://pokeapi.co/api/v2/item-attribute/5/" - }], - "category": { - "name": "standard-balls", - "url": "http://pokeapi.co/api/v2/item-category/34/" - }, - "effect_entries": [{ - "effect": "Used in battle\n: [Catches]{mechanic:catch} 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": "http://pokeapi.co/api/v2/language/9/" - } - }], - "flavor_text_entries": [{ - "text": "野生の ポケモンを 必ず\n捕まえることが できる\n最高 性能の ボール。", - "version_group": { - "name": "x-y", - "url": "http://pokeapi.co/api/v2/version-group/15/" - }, - "language": { - "name": "ja-kanji", - "url": "http://pokeapi.co/api/v2/language/11/" - } - }], - "game_indices": [{ - "game_index": 1, - "generation": { - "name": "generation-vi", - "url": "http://pokeapi.co/api/v2/generation/6/" - } - }], - "names": [{ - "name": "Master Ball", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "held_by_pokemon": [{ - "pokemon": { - "name": "chansey", - "url": "http://pokeapi.co/api/v2/pokemon/113/" - }, - "version_details": [{ - "rarity": 50, - "version": { - "name": "soulsilver", - "url": "http://pokeapi.co/api/v2/version/16/" - } - }] - }], - "baby_trigger_for": { - "url":"http://pokeapi.co/api/v2/evolution-chain/1/" - } -} -``` - -###### response models - -#### Item - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item resource | integer | -| name | The name for this item resource | string | -| cost | The price of this item in stores | integer | -| fling_power | The power of the move Fling when used with this item. | integer | -| fling_effect | The effect of the move Fling when used with this item | [ItemFlingEffect](#item-fling-effects) | -| attributes | A list of attributes this item has | list [NamedAPIResource](#namedapiresource) ([ItemAttribute](#item-attributes)) | -| category | The category of items this item falls into | [ItemCategory](#item-categories) | -| effect_entries | The effect of this ability listed in different languages | list [VerboseEffect](#verboseeffect) | -| flavor_text_entries | The flavor text of this ability listed in different languages | list [VersionGroupFlavorText](#versiongroupflavortext) | -| game_indices | A list of game indices relevent to this item by generation | list [GenerationGameIndex](#generationgameindex) | -| names | The name of this item listed in different languages | list [Name](#resourcename) | -| held_by_pokemon | A list of pokémon that might be found in the wild holding this item | list [HeldByPokemon](#heldbypokemon) | -| baby_trigger_for | An evolution chain this item requires to produce a bay during mating | list [APIResource](#apiresource) ([EvolutionChain](#evolution-chains)) | - -#### HeldByPokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| pokemon | The pokemon who might be holding the item | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | -| version_details | Details on chance of the pokemon having the item based on version | list [VersionDetails](#helditemversiondetails) | - -#### HeldItemVersionDetails - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| rarity | The chance of the pokemon holding the item | integer | -| version | The version the rarity applies | [NamedAPIResource](#namedapiresource) ([Version](#version)) | -## Item Attributes -Item attributes define particular aspects of items, e.g. "usable in battle" or "consumable". - -### GET api/v2/item-attribute/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "countable", - "descriptions": [{ - "description": "Has a count in the bag", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "items": [{ - "name": "master-ball", - "url": "http://pokeapi.co/api/v2/item/1/" - }], - "names": [{ - "name": "Countable", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### ItemAttribute - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item attribute resource | integer | -| name | The name for this item attribute resource | string | -| items | A list of items that have this attribute | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| names | The name of this item attribute listed in different languages | list [Name](#resourcename) | -| descriptions | The description of this item attribute listed in different languages | list [Description](#description) | - - -## Item Categories -Item categories determine where items will be placed in the players bag. - -### GET api/v2/item-category/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "stat-boosts", - "items": [{ - "name": "guard-spec", - "url": "http://pokeapi.co/api/v2/item/55/" - }], - "names": [{ - "name": "Stat boosts", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pocket": { - "name": "battle", - "url": "http://pokeapi.co/api/v2/item-pocket/7/" - } -} -``` - -###### response models - -#### ItemCategory - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item category resource | integer | -| name | The name for this item category resource | string | -| items | A list of items that are a part of this category | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| names | The name of this item category listed in different languages | list [Name](#resourcename) | -| pocket | The pocket items in this category would be put in | [NamedAPIResource](#namedapiresource) ([ItemPocket](#item-pockets)) | - - -## Item Fling Effects -The various effects of the move "Fling" when used with different items. - -### GET api/v2/item-fling-effect/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "badly-poison", - "effect_entries": [{ - "effect": "Badly poisons the target.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "items": [{ - "name": "toxic-orb", - "url": "http://pokeapi.co/api/v2/item/249/" - }] -} -``` - -###### response models - -#### ItemFlingEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this fling effect resource | integer | -| name | The name for this fling effect resource | string | -| effect_entries | The result of this fling effect listed in different languages | list [Effect](#effect) | -| items | A list of items that have this fling effect | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | - - -## Item Pockets -Pockets within the players bag used for storing items by category. - -### GET api/v2/item-pocket/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "misc", - "categories": [{ - "name": "collectibles", - "url": "http://pokeapi.co/api/v2/item-category/9/" - }], - "names": [{ - "name": "Items", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### ItemPocket - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this item pocket resource | integer | -| name | The name for this item pocket resource | string | -| categories | A list of item categories that are relevent to this item pocket | list [NamedAPIResource](#namedapiresource) ([ItemCategory](#item-categories)) | -| names | The name of this item pocket listed in different languages | list [Name](#resourcename) | - - -

Moves

- -## Moves -Moves are the skills of pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas. - -### GET api/v2/move/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "pound", - "accuracy": 100, - "effect_chance": null, - "pp": 35, - "priority": 0, - "power": 40, - "contest_combos": { - "normal": { - "use_before": [{ - "name": "double-slap", - "url": "http://pokeapi.co/api/v2/move/3/" - }, { - "name": "headbutt", - "url": "http://pokeapi.co/api/v2/move/29/" - }, { - "name": "feint-attack", - "url": "http://pokeapi.co/api/v2/move/185/" - }], - "use_after": null - }, - "super": { - "use_before": null, - "use_after": null - } - }, - "contest_type": { - "name": "tough", - "url": "http://pokeapi.co/api/v2/contest-type/5/" - }, - "contest_effect": { - "url": "http://pokeapi.co/api/v2/contest-effect/1/" - }, - "damage_class": { - "name": "physical", - "url": "http://pokeapi.co/api/v2/move-damage-class/2/" - }, - "effect_entries": [{ - "effect": "Inflicts [regular damage]{mechanic:regular-damage}.", - "short_effect": "Inflicts regular damage with no additional effect.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "effect_changes": [], - "generation": { - "name": "generation-i", - "url": "http://pokeapi.co/api/v2/generation/1/" - }, - "meta": { - "ailment": { - "name": "none", - "url": "http://pokeapi.co/api/v2/move-ailment/0/" - }, - "category": { - "name": "damage", - "url": "http://pokeapi.co/api/v2/move-category/0/" - }, - "min_hits": null, - "max_hits": null, - "min_turns": null, - "max_turns": null, - "drain": 0, - "healing": 0, - "crit_rate": 0, - "ailment_chance": 0, - "flinch_chance": 0, - "stat_chance": 0 - }, - "names": [{ - "name": "Pound", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "past_values": [], - "stat_changes": [], - "super_contest_effect": { - "url": "http://pokeapi.co/api/v2/super-contest-effect/5/" - }, - "target": { - "name": "selected-pokemon", - "url": "http://pokeapi.co/api/v2/move-target/10/" - }, - "type": { - "name": "normal", - "url": "http://pokeapi.co/api/v2/type/1/" - } -} -``` - -###### response models - -#### Move - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move resource | integer | -| name | The name for this move resource | string | -| accuracy | The percent value of how likely this move is to be successful | integer | -| effect_chance | The percent value of how likely it is this moves effect will happen | integer | -| pp | Power points. The number of times this move can be used | integer | -| priority | A value between -8 and 8. Sets the order in which moves are executed during battle. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Priority) for greater detail. | integer | -| power | The base power of this move with a value of 0 if it does not have a base power | integer | -| contest_combos | A detail of normal and super contest combos that require this move | list [ContestComboSets](#contestcombosets) | -| contest_type | The type of appeal this move gives a pokémon when used in a contest | [NamedAPIResource](#namedapiresource) ([ContestType](#contest-types)) | -| contest_effect | The effect the move has when used in a contest | [NamedAPIResource](#namedapiresource) ([ContestEffect](#contest-effects)) | -| damage_class | The type of damage the move inflicts on the target, e.g. physical | [NamedAPIResource](#namedapiresource) ([MoveDamageClass](#move-damage-classes)) | -| effect_entries | The effect of this move listed in different languages | list [VerboseEffect](#verboseeffect) | -| effect_changes | The list of previous effects this move has had across version groups of the games | list [AbilityEffectChange](#abilityeffectchange) | -| generation | The generation in which this move was introduced | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| meta | Meta data about this move | [MoveMetaData](#movemetadata) | -| names | The name of this move listed in different languages | list [Name](#resourcename) | -| past_values | A list of move resource value changes across ersion groups of the game | list [PastMoveStatValues](#pastmovestatvalues) | -| stat_changes | A list of stats this moves effects and how much it effects them | list [MoveStatChange](#movestatchange) | -| super_contest_effect | The effect the move has when used in a super contest | [NamedAPIResource](#namedapiresource) ([ContestEffect](#contest-effects)) | -| target | The type of target that will recieve the effects of the attack | [NamedAPIResource](#namedapiresource) ([MoveTarget](#move-targets)) | -| type | The elemental type of this move | [NamedAPIResource](#namedapiresource) ([Type](#types)) | - -#### ContestComboSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| normal | A detail of moves this move can be used before or after, granting additional appeal points in contests | list [ContestComboDetail](#contestcombodetail) | -| super | A detail of moves this move can be used before or after, granting additional appeal points in super contests | list [ContestComboDetail](#contestcombodetail) | - -#### ContestComboDetail - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| use_before | A list of moves to use before this move | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| use_after | A list of moves to use after this move | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - -#### MoveMetaData - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| ailment | The status ailment this move inflicts on its target | [NamedAPIResource](#namedapiresource) ([MoveAilment](#move-ailments)) | -| category | The category of move this move falls under, e.g. damage or ailment | [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| min_hits | The minimum number of times this move hits. Null if it always only hits once. | integer | -| max_hits | The maximum number of times this move hits. Null if it always only hits once. | integer | -| min_turns | The minimum number of turns this move continues to take effect. Null if it always only lasts one turn. | integer | -| max_turns | The maximum number of turns this move continues to take effect. Null if it always only lasts one turn. | integer | -| drain | HP drain (if positive) or Recoil damage (if negative), in percent of damage done | integer | -| healing | The amount of hp gained by the attacking pokémon, in percent of it's maximum HP | integer | -| crit_rate | Critical hit rate bonus | integer | -| ailment_chance | The likelyhood this attack will cause an ailment | integer | -| flinch_chance | The likelyhood this attack will cause the target pokémon to flinch | integer | -| stat_chance | The likelyhood this attack will cause a stat change in the target pokémon | integer | - -#### MoveStatChange - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| change | The amount of change | integer | -| stat | The stat being affected | [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | - -#### PastMoveStatValues - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| accuracy | The percent value of how likely this move is to be successful | integer | -| effect_chance | The percent value of how likely it is this moves effect will take effect | integer | -| power | The base power of this move with a value of 0 if it does not have a base power | integer | -| pp | Power points. The number of times this move can be used | integer | -| effect_entries | The effect of this move listed in different languages | list [VerboseEffect](#verboseeffect) | -| type | The elemental type of this move | [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| version group | The version group in which these move stat values were in effect | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -## Move Ailments -Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/http://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail. - -### GET api/v2/move-ailment/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "paralysis", - "moves": [{ - "name": "thunder-punch", - "url": "http://pokeapi.co/api/v2/move/9/" - }], - "names": [{ - "name": "Paralysis", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### Move Ailment - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move ailment resource | integer | -| name | The name for this move ailment resource | string | -| moves | A list of moves that cause this ailment | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| names | The name of this move ailment listed in different languages | list [Name](#resourcename) | - - -## Move Battle Styles -Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail. - -### GET api/v2/move-battle-style/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "attack", - "names": [{ - "name": "Attack", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### Move Battle Style - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move battle style resource | integer | -| name | The name for this move battle style resource | string | -| names | The name of this move battle style listed in different languages | list [Name](#resourcename) | - - -## Move Categories -Very general categories that loosely group move effects. - -### GET api/v2/move-category/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "ailment", - "descriptions": [{ - "description": "No damage; inflicts status ailment", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "moves": [{ - "name": "sing", - "url": "http://pokeapi.co/api/v2/move/47/" - }] -} -``` - -###### response models - -#### Move Category - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move category resource | integer | -| name | The name for this move category resource | string | -| moves | A list of moves that fall into this category | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| descriptions | The description of this move ailment listed in different languages | list [Description](#description) | - - -## Move Damage Classes -Damage classes moves can have, e.g. physical, special, or status (non-damaging). - -### GET api/v2/move-damage-class/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "status", - "descriptions": [{ - "description": "ダメージない", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }], - "moves": [{ - "name": "swords-dance", - "url": "http://pokeapi.co/api/v2/move/14/" - }] -} -``` - -###### response models - -#### Move Damage Class - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move damage class resource | integer | -| name | The name for this move damage class resource | string | -| descriptions | The description of this move damage class listed in different languages | list [Description](#description) | -| moves | A list of moves that fall into this damage class | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| names | The name of this move damage class listed in different languages | list [Name](#resourcename) | - - -## Move Learn Methods -Methods by which pokémon can learn moves. - -### GET api/v2/move-learn-method/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "level-up", - "names": [{ - "name": "Level up", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "descriptions": [{ - "description": "Wird gelernt, wenn ein Pokémon ein bestimmtes Level erreicht.", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} -``` - -###### response models - -#### Move Learn Method - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move learn method resource | integer | -| name | The name for this move learn method resource | string | -| descriptions | The description of this move learn method listed in different languages | list [Description](#description) | -| names | The name of this move learn method listed in different languages | list [Name](#resourcename) | -| version_groups | A list of version groups where moves can be learned through this method | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -## Move Targets -Targets moves can be directed at during battle. Targets can be pokémon, environments or even other moves. - -### GET api/v2/move-target/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "specific-move", - "descriptions": [{ - "description": "Eine spezifische Fähigkeit. Wie diese Fähigkeit genutzt wird hängt von den genutzten Fähigkeiten ab.", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "moves": [{ - "name": "counter", - "url": "http://pokeapi.co/api/v2/move/68/" - }], - "names": [{ - "name": "Spezifische Fähigkeit", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }] -} -``` - -###### response models - -#### Move Target - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this move target resource | integer | -| name | The name for this move target resource | string | -| descriptions | The description of this move target listed in different languages | list [Description](#description) | -| moves | A list of moves that that are directed at this target | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| names | The name of this move target listed in different languages | list [Name](#resourcename) | - - - -

Locations

- -## Locations -Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes. - -### GET api/v2/location/{id} - -###### example response - -```json -{ - "id": 1, - "name": "canalave-city", - "region": { - "name": "sinnoh", - "url": "http://pokeapi.co/api/v2/region/4/" - }, - "names": [{ - "name": "Canalave City", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "game_indices": [{ - "game_index": 7, - "generation": { - "name": "generation-iv", - "url": "http://pokeapi.co/api/v2/generation/4/" - } - }], - "areas": [{ - "name": "canalave-city-area", - "url": "http://pokeapi.co/api/v2/location-area/1/" - }] -} -``` - -###### response models - -#### Location - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this location resource | integer | -| name | The name for this location resource | string | -| region | The region this location can be found in | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| names | The name of this language listed in different languages | list [Name](#resourcename) | -| game_indices | A list of game indices relevent to this location by generation | list [GenerationGameIndex](#generationgameindex) | -| areas | Areas that can be found within this location | [APIResource](#apiresource) ([LocationArea](#location-areas)) | - - -## Location Areas -Location areas are sections of areas, such as floors in a building or cave. Each area has its own set of possible pokemon encounters. - -### GET api/v2/location-area/{id} - -###### example response - -```json -{ - "id": 1, - "name": "canalave-city-area", - "game_index": 1, - "encounter_method_rates": [{ - "encounter_method": { - "name": "old-rod", - "url": "http://pokeapi.co/api/v2/encounter-method/2/" - }, - "version_details": [{ - "rate": 25, - "version": { - "name": "platinum", - "url": "http://pokeapi.co/api/v2/version/14/" - } - }] - }], - "location": { - "name": "canalave-city", - "url": "http://pokeapi.co/api/v2/location/1/" - }, - "names": [{ - "name": "", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pokemon_encounters": [{ - "pokemon": { - "name": "tentacool", - "url": "http://pokeapi.co/api/v2/pokemon/72/" - }, - "version_details": [{ - "version": { - "name": "diamond", - "url": "http://pokeapi.co/api/v2/version/12/" - }, - "max_chance": 60, - "encounter_details": [{ - "min_level": 20, - "max_level": 30, - "condition_values": [], - "chance": 60, - "method": { - "name": "surf", - "url": "http://pokeapi.co/api/v2/encounter-method/5/" - } - }] - }] - }] -} -``` - -###### response models - -#### LocationArea - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this location resource | integer | -| name | The name for this location resource | string | -| game_index | The internal id of an api resource within game data | integer | -| encounter_method_rates | A list of methods in which pokémon may be encountered in this area and how likely the method will occur depending on the version of the game | list [EncounterMethodRate](#encountermethodrate) | -| location | The region this location can be found in | [NamedAPIResource](#namedapiresource) ([Region](#regions)) | -| names | The name of this location area listed in different languages | list [Name](#resourcename) | -| pokemon_encounters | A list of pokémon that can be encountered in this area along with version specific details about the encounter | list [PokemonEncounter](#pokemonencounter) | - -#### EncounterMethodRate - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| encounter_method | The method in which pokémon may be encountered in an area. | [EncounterMethod](#encountermehtod) | -| version_details | The chance of the encounter to occur on a version of the game. | list [EncounterVersionDetails](#encounterversiondetails) | - -#### EncounterVersionDetails - -| Name | Description | Data Type | -| ------- | ----------- | --------- | -| rate | The chance of an encounter to occur. | integer | -| version | The version of the game in which the encounter can occur with the given chance. | [NamedAPIResource](#namedapiresource) ([Version](#version)) | - -#### PokemonEncounter - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| pokemon | The pokémon being encountered | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | -| version_details | A list of versions and encounters with pokémon that might happen in the referenced location area | list [VersionEncounterDetail](#versionencounterdetail) | - - -## Pal Park Areas -Areas used for grouping pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park. - -### GET api/v2/pal-park-area/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "forest", - "names": [{ - "name": "Forest", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "pokemon_encounters": [{ - "base_score": 30, - "rate": 50, - "pokemon_species": { - "name": "caterpie", - "url": "http://pokeapi.co/api/v2/pokemon-species/10/" - } - }] -} -``` - -###### response models - -#### PalParkArea - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pal park area resource | integer | -| name | The name for this pal park area resource | string | -| names | The name of this pal park area listed in different languages | list [Name](#resourcename) | -| pokemon_encounters | A list of pokémon encountered in thi pal park area along with details | list [PalParkEncounterSpecies](#palparkencounterspecies) | - -#### PalParkEncounterSpecies - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| base_score | The base score given to the player when this pokémon is caught during a pal park run | integer | -| rate | The base rate for encountering this pokémon in this pal park area | integer | -| pokemon_species | The pokémon species being encountered | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemonspecies)) | - - -## Regions -A region is an organized area of the pokémon world. Most often, the main difference between regions is the species of pokémon that can be encountered within them. - -### GET api/v2/region/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "kanto", - "locations": [{ - "name": "celadon-city", - "url": "http://pokeapi.co/api/v2/location/67/" - }], - "main_generation": { - "name": "generation-i", - "url": "http://pokeapi.co/api/v2/generation/1/" - }, - "names": [{ - "name": "Kanto", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "pokedexes": [{ - "name": "kanto", - "url": "http://pokeapi.co/api/v2/pokedex/2/" - }], - "version_groups": [{ - "name": "red-blue", - "url": "http://pokeapi.co/api/v2/version-group/1/" - }] -} -``` - -###### response models - -#### Region - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this region resource | integer | -| name | The name for this region resource | string | -| locations | A list of locations that can be found in this region | [NamedAPIResource](#namedapiresource) ([Location](#locations)) | -| main_generation | The generation this region was introduced in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| names | The name of this region listed in different languages | list [Name](#resourcename) | -| pokedexes | A list of pokédexes that catalogue pokemon in this region | list [NamedAPIResource](#namedapiresource) ([Pokedex](#pokedexes)) | -| version_groups | A list of version groups where this region can be visited | list [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - -

Pokemon

- -## Abilities - -Abilities provide passive effects for pokémon in battle or in the overworld. Pokémon have mutiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail. - -### GET api/v2/ability/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "stench", - "is_main_series": true, - "generation": { - "name": "generation-iii", - "url": "http://pokeapi.co/api/v2/generation/3/" - }, - "names": [{ - "name": "Stench", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "effect_entries": [{ - "effect": "This Pokémon's damaging moves have a 10% chance to make the target [flinch]{mechanic:flinch} with each hit if they do not already cause flinching as a secondary effect.\n\nThis ability does not stack with a held item.\n\nOverworld: The wild encounter rate is halved while this Pokémon is first in the party.", - "short_effect": "Has a 10% chance of making target Pokémon [flinch]{mechanic:flinch} with each hit.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "effect_changes": [{ - "version_group": { - "name": "black-white", - "url": "http://pokeapi.co/api/v2/version-group/11/" - }, - "effect_entries": [{ - "effect": "Has no effect in battle.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] - }], - "flavor_text_entries": [{ - "flavor_text": "臭くて 相手が\nひるむ ことがある。", - "language": { - "name": "ja-kanji", - "url": "http://pokeapi.co/api/v2/language/11/" - }, - "version_group": { - "name": "x-y", - "url": "http://pokeapi.co/api/v2/version-group/15/" - } - }], - "pokemon": [{ - "is_hidden": true, - "slot": 3, - "pokemon": { - "name": "gloom", - "url": "http://pokeapi.co/api/v2/pokemon/44/" - } - }] -} -``` - -###### response models - -#### Ability - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this ability resource | integer | -| name | The name for this ability resource | string | -| is_main_series | Whether or not this ability originated in the main series of the video games | boolean | -| generation | The generation this ability originated in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| names | The name of this ability listed in different languages | list [Name](#resourcename) | -| effect_entries | The effect of this ability listed in different languages | list [VerboseEffect](#verboseeffect) | -| effect_changes | The list of previous effects this ability has had across version groups | list [AbilityEffectChange](#abilityeffectchange) | -| flavor_text_entries | The flavor text of this ability listed in different languages | list [VersionGroupFlavorText](#versiongroupflavortext) | -| pokemon | A list of pokémon that could potentially have this ability | list [AbilityPokemon](#abilitypokemon) | - -#### AbilityEffectChange - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| effect_entries | The previous effect of this ability listed in different languages | [Effect](#effect) | -| version_group | The version group in which the previous effect of this ability originated | [NamedAPIResource](#namedapiresource) ([VersionGroup](#versiongroups)) | - -#### AbilityFlavorText - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| flavor_text | The localized name for an api resource in a specific language | string | -| language | The language this name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | -| version_group | The version group that uses this flavor text | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - -#### AbilityPokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| is_hidden | Whether or not this a hidden ability for the referenced pokémon | boolean | -| slot | Pokémon have 3 ability 'slots' which hold references to possible abilities they could have. This is the slot of this ability for the referenced pokémon. | integer | -| pokemon | The pokémon this ability could belong to | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | - - -## Characteristics -Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail. - -### GET api/v2/characteristic/{id} - -###### example response - -```json -{ - "id": 1, - "gene_modulo": 0, - "possible_values": [0, 5, 10, 15, 20, 25, 30], - "highest_stat": { - "name": "hp", - "url": "http://pokeapi.co/api/v2/stat/1/" - }, - "descriptions": [{ - "description": "Loves to eat", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} - -``` - -###### response models - -#### Characteristic - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this characteristic resource | integer | -| gene_modulo | The remainder of the highest stat/IV divided by 5 | integer | -| possible_values | The possible values of the highest stat that would result in a pokémon recieving this characteristic when divided by 5 | list integer | -| descriptions | The descriptions of this characteristic listed in different languages | list [Description](#description) | - - -## Egg Groups -Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail. - -### GET api/v2/egg-group/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "monster", - "names": [{ - "name": "かいじゅう", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }], - "pokemon_species": [{ - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - }] -} - -``` - -###### response models - -#### EggGroup - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this egg group resource | integer | -| name | The name for this egg group resource | string | -| names | The name of this egg group listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of all pokémon species that are members of this egg group | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Genders -Genders were introduced in Generation II for the purposes of breeding pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail. - -### GET api/v2/gender/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "female", - "pokemon_species_details": [{ - "rate": 1, - "pokemon_species": { - "name": "bulbasaur", - "url": "http://pokeapi.co/api/v2/pokemon-species/1/" - } - }], - "required_for_evolution": [{ - "name": "wormadam", - "url": "http://pokeapi.co/api/v2/pokemon-species/413/" - }] -} - -``` - -###### response models - -#### Gender - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this gender resource | integer | -| name | The name for this gender resource | string | -| pokemon_species_details | A list of pokémon species that can be this gender and how likely it is that they will be | list [PokemonSpeciesGender](#pokemonspeciesgender) | -| required_for_evolution | A list of pokémon species that required this gender in order for a pokémon to evolve into them | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -#### PokemonSpeciesGender - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| rate | The chance of this Pokémon being female, in eighths; or -1 for genderless | integer | -| pokemon_species | A pokemon species that can be the referenced gender | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Growth Rates -Growth rates are the speed with which pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail. - -### GET api/v2/growth-rate/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "slow", - "formula": "\\frac{5x^3}{4}", - "descriptions": [{ - "description": "langsam", - "language": { - "name": "de", - "url": "http://pokeapi.co/api/v2/language/6/" - } - }], - "levels": [{ - "level": 100, - "experience": 1250000 - }], - "pokemon_species": [{ - "name": "growlithe", - "url": "http://pokeapi.co/api/v2/pokemon-species/58/" - }] -} -``` - -###### response models - -#### Growth Rate - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this gender resource | integer | -| name | The name for this gender resource | string | -| formula | The formula used to calculate the rate at which the pokémon species gains level | string | -| descriptions | The descriptions of this characteristic listed in different languages | list [Description](#description) | -| levels | A list of levels and the amount of experienced needed to atain them based on this growth rate | list [GrowthRateExperienceLevel](#growthrateexperiencelevel) | -| pokemon_species | A list of pokémon species that gain levels at this growth rate | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - -#### GrowthRateExperienceLevel - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| level | The level gained | integer | -| experience | The amount of experience required to reach the referenced level | integer | - - -## Natures -Natures influence how a pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail. - -### GET api/v2/nature/{id or name} - -###### example response - -```json -{ - "id": 2, - "name": "bold", - "decreased_stat": { - "name": "attack", - "url": "http://pokeapi.co/api/v2/stat/2/" - }, - "increased_stat": { - "name": "defense", - "url": "http://pokeapi.co/api/v2/stat/3/" - }, - "likes_flavor": { - "name": "sour", - "url": "http://pokeapi.co/api/v2/berry-flavor/5/" - }, - "hates_flavor": { - "name": "spicy", - "url": "http://pokeapi.co/api/v2/berry-flavor/1/" - }, - "pokeathlon_stat_changes": [{ - "max_change": -2, - "pokeathlon_stat": { - "name": "speed", - "url": "http://pokeapi.co/api/v2/pokeathlon-stat/1/" - } - }], - "move_battle_style_preferences": [{ - "low_hp_preference": 32, - "high_hp_preference": 30, - "move_battle_style": { - "name": "attack", - "url": "http://pokeapi.co/api/v2/move-battle-style/1/" - } - }], - "names": [{ - "name": "ずぶとい", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }] -} -``` - -###### response models - -#### Nature - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this nature resource | integer | -| name | The name for this nature resource | string | -| decreased_stat | The stat decreased by 10% in pokémon with this nature | [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | -| increased_stat | The stat increased by 10% in pokémon with this nature | [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | -| hates_flavor | The flavor hated by pokémon with this nature | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | -| likes_flavor | The flavor liked by pokémon with this nature | [NamedAPIResource](#namedapiresource) ([BerryFlavor](#berry-flavors)) | -| pokeathlon_stat_changes | A list of pokéathlon stats this nature effects and how much it effects them | list [NatureStatChange](#naturestatchange) | -| move_battle_style_preferences | A list of battle styles and how likely a pokémon with this nature is to use them in the Battle Palace or Battle Tent. | list [MoveBattleStylePreference](#movebattlestylepreference) | -| names | The name of this nature listed in different languages | list [Name](#resourcename) | - -#### NatureStatChange - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| change | The amount of change | integer | -| stat | The stat being affected | [NamedAPIResource](#namedapiresource) ([PokeathlonStat](#pokeathlon-stats)) | - -#### MoveBattleStylePreference - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| low_hp_preference | Chance of using the move, in percent, if HP is under one half | integer | -| high_hp_preference | Chance of using the move, in percent, if HP is over one half | integer | -| move_battle_style | The move battle style | [NamedAPIResource](#namedapiresource) ([MoveBattleStyle](#move-battle-styles)) | - - -## Pokéathlon Stats -Pokéathlon Stats are different attributes of a pokémon's performance in pokeathlons. In Pokéathlons, competitions happen on different courses; one for each of the different pokeathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokéathlon) for greater detail. - -### GET api/v2/pokeathlon-stat/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "speed", - "affecting_natures": { - "increase": [{ - "max_change": 2, - "nature": { - "name": "timid", - "url": "http://pokeapi.co/api/v2/nature/5/" - } - }], - "decrease": [{ - "max_change": -1, - "nature": { - "name": "hardy", - "url": "http://pokeapi.co/api/v2/nature/1/" - } - }] - }, - "names": [{ - "name": "Speed", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### PokeathlonStat - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokéathlon stat resource | integer | -| name | The name for this pokéathlon stat resource | string | -| names | The name of this pokéathlon stat listed in different languages | list [Name](#resourcename) | -| affecting_natures | A detail of natures which affect this pokéathlon stat positively or negatively | [NaturePokeathlonStatAffectSets](#naturepokeathlonstataffectsets) | - -#### NaturePokeathlonStatAffectSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| increase | A list of natures and how they change the referenced pokéathlon stat | list [NaturePokeathlonStatAffect](#naturepokeathlonstataffect) | -| decrease | A list of natures and how they change the referenced pokéathlon stat | list [NaturePokeathlonStatAffect](#naturepokeathlonstataffect) | - -#### NaturePokeathlonStatAffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| max_change | The maximum amount of change to the referenced pokéathlon stat | integer | -| nature | The nature causing the change | [NamedAPIResource](#namedapiresource) ([Nature](#natures)) | - - - -## Pokémon -Pokémon are the creatures that inhabit the world of the pokemon games. They can be caught using pokéballs and trained by battling with other pokémon. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pokémon_(species)) for greater detail. - -### GET api/v2/pokemon/{id or name} - -###### example response - -```json -{ - "id": 35, - "name": "clefairy", - "base_experience": 113, - "height": 6, - "is_default": true, - "order": 56, - "weight": 75, - "abilities": [{ - "is_hidden": true, - "slot": 3, - "ability": { - "name": "friend-guard", - "url": "https://pokeapi.co/api/v2/ability/132/" - } - }], - "forms": [{ - "name": "clefairy", - "url": "https://pokeapi.co/api/v2/pokemon-form/35/" - }], - "game_indices": [{ - "game_index": 35, - "version": { - "name": "white-2", - "url": "https://pokeapi.co/api/v2/version/22/" - } - }], - "held_items": [{ - "item": { - "name": "moon-stone", - "url": "https://pokeapi.co/api/v2/item/81/" - }, - "version_details": [{ - "rarity": 5, - "version": { - "name": "ruby", - "url": "https://pokeapi.co/api/v2/version/7/" - } - }] - }], - "location_area_encounters": "/api/v2/pokemon/35/encounters", - "moves": [{ - "move": { - "name": "pound", - "url": "https://pokeapi.co/api/v2/move/1/" - }, - "version_group_details": [{ - "level_learned_at": 1, - "version_group": { - "name": "red-blue", - "url": "https://pokeapi.co/api/v2/version-group/1/" - }, - "move_learn_method": { - "name": "level-up", - "url": "https://pokeapi.co/api/v2/move-learn-method/1/" - } - }] - }], - "species": { - "name": "clefairy", - "url": "https://pokeapi.co/api/v2/pokemon-species/35/" - }, - "stats": [{ - "base_stat": 35, - "effort": 0, - "stat": { - "name": "speed", - "url": "https://pokeapi.co/api/v2/stat/6/" - } - }], - "types": [{ - "slot": 1, - "type": { - "name": "fairy", - "url": "https://pokeapi.co/api/v2/type/18/" - } - }], - "past_types": [{ - "generation": { - "name": "generation-v", - "url": "https://pokeapi.co/api/v2/generation/5/" - }, - "types": [ - { - "slot": 1, - "type": { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - } - ] - }] -} -``` - -###### response models - -#### Pokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon resource | integer | -| name | The name for this pokémon resource | string | -| base_experience | The base experience gained for defeating this pokémon | integer | -| height | The height of this pokémon | integer | -| is_default | Set for exactly one pokémon used as the default for each species | boolean | -| order | Order for sorting. Almost national order, except families are grouped together. | integer | -| weight | The mass of this pokémon | integer | -| abilities | A list of abilities this pokémon could potentially have | list [PokemonAbility](#pokemonability) | -| forms | A list of forms this pokémon can take on | list [NamedAPIResource](#namedapiresource) ([PokemonForm](#pokemon-forms)) | -| game_indices | A list of game indices relevent to pokémon item by generation | list [VersionGameIndex](#versiongameindex) | -| held_items | A list of items this pokémon may be holding when encountered | list [NamedAPIResource](#namedapiresource) ([Item](#items)) | -| location_area_encounters | A list of location areas as well as encounter details pertaining to specific versions | list [LocationAreaEncounter](#locationareaencounter) | -| moves | A list of moves along with learn methods and level details pertaining to specific version groups | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | -| species | The species this pokémon belongs to | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| stats | A list of base stat values for this pokémon | list [NamedAPIResource](#namedapiresource) ([Stat](#stats)) | -| types | A list of details showing types this pokémon has | list [PokemonType](#pokemontype) | -| past_types | A list of details showing types this pokémon had in previous generations | list [PokemonTypePast](#pokemontypepast) | - -#### PokemonAbility - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| is_hidden | Whether or not this is a hidden ability | boolean | -| slot | The slot this ability occupies in this pokémon species | integer | -| ability | The ability the pokémon may have | [NamedAPIResource](#namedapiresource) ([Ability](#abilities)) | - -#### PokemonType - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| slot | The order the pokémon types are listed in | integer | -| type | The type the referenced pokémon has | string | - -#### PokemonFormType - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| slot | The order the Pokémon form types are listed in | integer | -| type | The type the referenced Pokémon form has | string | - -#### PokemonTypePast - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| generation | The last generation in which the referenced pokémon had the listed types | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| types | The types the referenced pokémon had up to and including the listed generation | list [PokemonType](#pokemontype) | - -#### LocationAreaEncounter - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| location_area | The location area the referenced pokémon can be encountered in | [APIResource](#apiresource) ([LocationArea](#location-areas)) | -| version_details | A list of versions and encounters with the referenced pokémon that might happen | list [VersionEncounterDetail](#versionencounterdetail) | - - -## Pokémon Colors -Colors used for sorting pokémon in a pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown. - -### GET api/v2/pokemon-color/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "black", - "names": [{ - "name": "黒い", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }], - "pokemon_species": [{ - "name": "snorlax", - "url": "http://pokeapi.co/api/v2/pokemon-species/143/" - }] -} -``` - -###### response models - -#### PokemonColor - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon color resource | integer | -| name | The name for this pokémon color resource | string | -| names | The name of this pokémon color listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of the pokémon species that have this color | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Pokémon Forms -Some pokémon have the ability to take on different forms. At times, these differences are purely cosmetic and have no bearing on the difference in the Pokémon's stats from another; however, several Pokémon differ in stats (other than HP), type, and Ability depending on their form. - -### GET api/v2/pokemon-form/{id or name} - -###### example response - -```json -{ - "id": 10041, - "name": "arceus-bug", - "order": 631, - "form_order": 7, - "is_default": false, - "is_battle_only": false, - "is_mega": false, - "form_name": "bug", - "pokemon": { - "name": "arceus", - "url": "https://pokeapi.co/api/v2/pokemon/493/" - }, - "version_group": { - "name": "diamond-pearl", - "url": "https://pokeapi.co/api/v2/version-group/8/" - }, - "types": [ - { - "slot": 1, - "type": { - "name": "bug", - "url": "https://pokeapi.co/api/v2/type/7/" - } - } - ] -} -``` - -###### response models - -#### PokemonForm - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon form resource | integer | -| name | The name for this pokémon form resource | string | -| order | The order in which forms should be sorted within all forms. Multiple forms may have equal order, in which case they should fall back on sorting by name. | integer | -| form_order | The order in which forms should be sorted within a species' forms | integer | -| is_default | True for exactly one form used as the default for each pokémon | boolean | -| is_battle_only | Whether or not this form can only happen during battle | boolean | -| is_mega | Whether or not this form requires mega evolution | boolean | -| form_name | The name of this form | string | -| pokemon | The pokémon that can take on this form | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | -| version_group | The version group this pokémon form was introduced in | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | -| types | A list of details showing types this Pokémon form has, if they differ from the types of the Pokémon that can take on this form | list [PokemonFormType](#pokemonformtype) | - - -## Pokémon Habitats -Habitats are generally different terrain pokémon can be found in but can also be areas designated for rare or legendary pokémon. - -### GET api/v2/pokemon-habitat/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "cave", - "names": [ - { - "name": "grottes", - "language": { - "name": "fr", - "url": "http://pokeapi.co/api/v2/language/5/" - } - } - ], - "pokemon_species": [ - { - "name": "zubat", - "url": "http://pokeapi.co/api/v2/pokemon-species/41/" - } - ] -} -``` - -###### response models - -#### PokemonHabitat - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon habitat resource | integer | -| name | The name for this pokémon habitat resource | string | -| names | The name of this pokémon habitat listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of the pokémon species that can be found in this habitat | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - - -## Pokémon Shapes -Shapes used for sorting pokémon in a pokédex. - -### GET api/v2/pokemon-shape/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "ball", - "awesome_names": [ - { - "awesome_name": "Pomaceous", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - } - ], - "names": [ - { - "name": "Ball", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - } - ], - "pokemon_species": [ - { - "name": "shellder", - "url": "http://pokeapi.co/api/v2/pokemon-species/90/" - } - ] -} -``` - -###### response models - -#### PokemonShape - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon shape resource | integer | -| name | The name for this pokémon shape resource | string | -| awesome_names | The "scientific" name of this pokémon shape listed in different languages | list [AwesomeName](#awesomename) | -| names | The name of this pokémon shape listed in different languages | list [Name](#resourcename) | -| pokemon_species | A list of the pokémon species that have this shape | list [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | - -#### AwesomeName - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| awesome_name | The localized "scientific" name for an api resource in a specific language | string | -| language | The language this "scientific" name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -## Pokémon Species -A Pokémon Species forms the basis for at least one pokémon. Attributes of a Pokémon species are shared across all varieties of pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant. - -### GET api/v2/pokemon-species/{id or name} - -###### example response - -```json -{ - "id": 413, - "name": "wormadam", - "order": 441, - "gender_rate": 8, - "capture_rate": 45, - "base_happiness": 70, - "is_baby": false, - "hatch_counter": 15, - "has_gender_differences": false, - "forms_switchable": false, - "growth_rate": { - "name": "medium", - "url": "http://pokeapi.co/api/v2/growth-rate/2/" - }, - "pokedex_numbers": [{ - "entry_number": 45, - "pokedex": { - "name": "kalos-central", - "url": "http://pokeapi.co/api/v2/pokedex/12/" - } - }], - "egg_groups": [{ - "name": "bug", - "url": "http://pokeapi.co/api/v2/egg-group/3/" - }], - "color": { - "name": "gray", - "url": "http://pokeapi.co/api/v2/pokemon-color/4/" - }, - "shape": { - "name": "squiggle", - "url": "http://pokeapi.co/api/v2/pokemon-shape/2/" - }, - "evolves_from_species": { - "name": "burmy", - "url": "http://pokeapi.co/api/v2/pokemon-species/412/" - }, - "evolution_chain": { - "url": "http://pokeapi.co/api/v2/evolution-chain/213/" - }, - "habitat": null, - "generation": { - "name": "generation-iv", - "url": "http://pokeapi.co/api/v2/generation/4/" - }, - "names": [{ - "name": "Wormadam", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "form_descriptions": [{ - "description": "Forms have different stats and movepools. During evolution, Burmy's current cloak becomes Wormadam's form, and can no longer be changed.", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "genera": [{ - "genus": "Bagworm", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }], - "varieties": [{ - "is_default": true, - "pokemon": { - "name": "wormadam-plant", - "url": "http://pokeapi.co/api/v2/pokemon/413/" - } - }] -} -``` - -###### response models - -#### PokemonSpecies - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this pokémon species resource | integer | -| name | The name for this pokémon species resource | string | -| order | The order in which species should be sorted. Based on National Dex order, except families are grouped together and sorted by stage. | integer | -| gender_rate | The chance of this Pokémon being female, in eighths; or -1 for genderless | integer | -| capture_rate | The base capture rate; up to 255. The higher the number, the easier the catch. | integer | -| base_happiness | The happiness when caught by a normal pokéball; up to 255. The higher the number, the happier the pokémon. | integer | -| is_baby | Whether or not this is a baby pokémon | boolean | -| hatch_counter | Initial hatch counter: one must walk 255 × (hatch_counter + 1) steps before this Pokémon's egg hatches, unless utilizing bonuses like Flame Body's | integer | -| has_gender_differences | Whether or not this pokémon can have different genders | boolean | -| forms_switchable | Whether or not this pokémon has multiple forms and can switch between them | boolean | -| growth_rate | The rate at which this pokémon species gains levels | [NamedAPIResource](#namedapiresource) ([GrowthRate](#growth-rates)) | -| pokedex_numbers | A list of pokedexes and the indexes reserved within them for this pokémon species | list [PokemonSpeciesDexEntry](#pokemonspeciesdexentry) | -| egg_groups | A list of egg groups this pokémon species is a member of | list [NamedAPIResource](#namedapiresource) ([EggGroup](#egg-groups)) | -| color | The color of this pokémon for gimmicky pokedex search | list [NamedAPIResource](#namedapiresource) ([PokemonColor](#pokemon-colors)) | -| shape | The shape of this pokémon for gimmicky pokedex search | list [NamedAPIResource](#namedapiresource) ([PokemonShape](#pokemon-shapes)) | -| evolves_from_species | The pokémon species that evolves into this pokemon_species | [NamedAPIResource](#namedapiresource) ([PokemonSpecies](#pokemon-species)) | -| evolution_chain | The evolution chain this pokémon species is a member of | [APIResource](#apiresource) ([EvolutionChain](#evolution-chains)) | -| habitat | The habitat this pokémon species can be encountered in | [NamedAPIResource](#namedapiresource) ([PokemonHabitat](#pokemon-habitats)) | -| generation | The generation this pokémon species was introduced in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| names | The name of this pokémon species listed in different languages | list [Name](#resourcename) | -| pal_park_encounters | A list of encounters that can be had with this pokémon species in pal park | list [PalParkEncounterArea](#palparkencounterarea) | -| form_descriptions | Descriptions of different forms pokémon take on within the pokémon species | list [Description](#description) | -| genera | The genus of this pokémon species listed in multiple languages | [Genus](#genus) | -| varieties | A list of the pokémon that exist within this pokémon species | list [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | - -#### Genus - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| genus | The localized genus for the referenced pokémon species | string | -| language | The language this genus is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - -#### PokemonSpeciesDexEntry - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| entry_number | The index number within the pokédex | integer | -| name | The pokédex the referenced pokémon species can be found in | [NamedAPIResource](#namedapiresource) ([Pokedex](#pokedexes)) | - -#### PalParkEncounterArea - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| base_score | The base score given to the player when the referenced pokemon is caught during a pal park run | integer | -| rate | The base rate for encountering the referenced pokemon in this pal park area | integer | -| area | The pal park area where this encounter happens | [NamedAPIResource](#namedapiresource) ([PalParkArea](#pal-park-areas)) | - - -## Stats -Stats determine certain aspects of battles. Each pokémon has a value for each stat which grows as they gain levels and can be altered momenarily by effects in battles. - -### GET api/v2/stat/{id or name} - -###### example response - -```json -{ - "id": 2, - "name": "attack", - "game_index": 2, - "is_battle_only": false, - "affecting_moves": { - "increase": [{ - "change": 2, - "move": { - "name": "swords-dance", - "url": "http://pokeapi.co/api/v2/move/14/" - } - }], - "decrease": [{ - "change": -1, - "move": { - "name": "growl", - "url": "http://pokeapi.co/api/v2/move/45/" - } - }] - }, - "affecting_natures": { - "increase": [{ - "name": "lonely", - "url": "http://pokeapi.co/api/v2/nature/6/" - }], - "decrease": [{ - "name": "bold", - "url": "http://pokeapi.co/api/v2/nature/2/" - }] - }, - "characteristics": [{ - "url": "http://pokeapi.co/api/v2/characteristic/2/" - }], - "move_damage_class": { - "name": "physical", - "url": "http://pokeapi.co/api/v2/move-damage-class/2/" - }, - "names": [{ - "name": "こうげき", - "language": { - "name": "ja", - "url": "http://pokeapi.co/api/v2/language/1/" - } - }] -} -``` - -###### response models - -#### Stat - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this stat resource | integer | -| name | The name for this stat resource | string | -| game_index | ID the games use for this stat | integer | -| is_battle_only | Whether this stat only exists within a battle | boolean | -| affecting_moves | A detail of moves which affect this stat positively or negatively | [MoveStatAffectSets](#movestataffectsets) | -| affecting_natures | A detail of natures which affect this stat positively or negatively | [NatureStatAffectSets](#naturestataffectsets) | -| characteristics | A list of characteristics that are set on a pokemon when its highest base stat is this stat | list [APIResource](#apiresource) ([Characteristic](#characteristics)) | -| move_damage_class | The class of damage this stat is directly related to | [NamedAPIResource](#namedapiresource) ([MoveDamageClass](#move-damage-classes)) | -| names | The name of this region listed in different languages | list [Name](#resourcename) | - -#### MoveStatAffectSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| increase | A list of moves and how they change the referenced stat | list [MoveStatAffect](#movestataffect) | -| decrease | A list of moves and how they change the referenced stat | list [MoveStatAffect](#movestataffect) | - -#### MoveStatAffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| max_change | The maximum amount of change to the referenced stat | integer | -| move | The move causing the change | [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - -#### NatureStatAffectSets - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| increase | A list of natures and how they change the referenced stat | list [NatureStatAffect](#naturestataffect) | -| decrease | A list of natures and how they change the referenced stat | list [NatureStatAffect](#naturestataffect) | - -#### NatureStatAffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| max_change | The maximum amount of change to the referenced stat | integer | -| nature | The nature causing the change | [NamedAPIResource](#namedapiresource) ([Nature](#natures)) | - - - - -## Types -Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against. - -### GET api/v2/type/{id or name} - -###### example response - -```json -{ - "id": 8, - "name": "ghost", - "damage_relations": { - "no_damage_to": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_to": [ - { - "name": "dark", - "url": "https://pokeapi.co/api/v2/type/17/" - } - ], - "double_damage_to": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ], - "no_damage_from": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_from": [ - { - "name": "poison", - "url": "https://pokeapi.co/api/v2/type/4/" - } - ], - "double_damage_from": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ] - }, - "past_damage_relations": [ - { - "generation": { - "name": "generation-v", - "url": "https://pokeapi.co/api/v2/generation/5/" - }, - "damage_relations": { - "no_damage_to": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_to": [ - { - "name": "steel", - "url": "https://pokeapi.co/api/v2/type/9/" - } - ], - "double_damage_to": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ], - "no_damage_from": [ - { - "name": "normal", - "url": "https://pokeapi.co/api/v2/type/1/" - } - ], - "half_damage_from": [ - { - "name": "poison", - "url": "https://pokeapi.co/api/v2/type/4/" - } - ], - "double_damage_from": [ - { - "name": "ghost", - "url": "https://pokeapi.co/api/v2/type/8/" - } - ] - } - } - ], - "game_indices": [ - { - "game_index": 8, - "generation": { - "name": "generation-i", - "url": "https://pokeapi.co/api/v2/generation/1/" - } - } - ], - "generation": { - "name": "generation-i", - "url": "https://pokeapi.co/api/v2/generation/1/" - }, - "move_damage_class": { - "name": "physical", - "url": "https://pokeapi.co/api/v2/move-damage-class/2/" - }, - "names": [ - { - "name": "ゴースト", - "language": { - "name": "ja-Hrkt", - "url": "https://pokeapi.co/api/v2/language/1/" - } - } - ], - "pokemon": [ - { - "slot": 1, - "pokemon": { - "name": "gastly", - "url": "https://pokeapi.co/api/v2/pokemon/92/" - } - } - ], - "moves": [ - { - "name": "night-shade", - "url": "https://pokeapi.co/api/v2/move/101/" - } - ] -} -``` - -###### response models - -#### Type - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this type resource | integer | -| name | The name for this type resource | string | -| damage_relations | A detail of how effective this type is toward others and vice versa | [TypeRelations](#typerelations) | -| past_damage_relations | A list of details of how effective this type was toward others and vice versa in previous generations | list [TypeRelationsPast](#typerelationspast) | -| game_indices | A list of game indices relevent to this item by generation | list [GenerationGameIndex](#generationgameindex) | -| generation | The generation this type was introduced in | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| move_damage_class | The class of damage inflicted by this type | [NamedAPIResource](#namedapiresource) ([MoveDamageClass](#move-damage-classes)) | -| names | The name of this type listed in different languages | list [Name](#resourcename) | -| pokemon | A list of details of pokemon that have this type | [TypePokemon](#typepokemon) | -| moves | A list of moves that have this type | list [NamedAPIResource](#namedapiresource) ([Move](#moves)) | - -#### TypePokemon - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| slot | The order the pokemons types are listed in | integer | -| pokemon | The pokemon that has the referenced type | [NamedAPIResource](#namedapiresource) ([Pokemon](#pokemon)) | - -#### TypeRelations - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| no_damage_to | A list of types this type has no effect on | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| half_damage_to | A list of types this type is not very effect against | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| double_damage_to | A list of types this type is very effect against | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| no_damage_from | A list of types that have no effect on this type | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| half_damage_from | A list of types that are not very effective against this type | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | -| double_damage_from | A list of types that are very effective against this type | list [NamedAPIResource](#namedapiresource) ([Type](#types)) | - -#### TypeRelationsPast - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| generation | The last generation in which the referenced type had the listed damage relations | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | -| damage_relations | The damage relations the referenced type had up to and including the listed generation | list [TypeRelations](#typerelations) | - - -

Utility

- -## Languages -Languages for translations of api resource information. - -### GET api/v2/language/{id or name} - -###### example response - -```json -{ - "id": 1, - "name": "ja", - "official": true, - "iso639": "ja", - "iso3166": "jp", - "names": [{ - "name": "Japanese", - "language": { - "name": "en", - "url": "http://pokeapi.co/api/v2/language/9/" - } - }] -} -``` - -###### response models - -#### Language - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| id | The identifier for this language resource | integer | -| name | The name for this language resource | string | -| official | Whether or not the games are published in this language | boolean | -| iso639 | The two-letter code of the country where this language is spoken. Note that it is not unique. | string | -| iso3166 | The two-letter code of the language. Note that it is not unique. | string | -| names | The name of this language listed in different languages | list [Name](#resourcename) | - - - -## Common Models - -#### APIResource - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| url | The url of the referenced resource | string | - - -#### Description - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| description | The localized description for an api resource in a specific language | string | -| language | The language this description is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### Effect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| effect | The localized effect text for an api resource in a specific language | string | -| language | The language this effect is in | [NamedAPIResource](#namedapiresource) ([Language](#language)) | - - -#### Encounter - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| min_level | The lowest level the pokemon could be encountered at | integer | -| max_level | The highest level the pokemon could be encountered at | integer | -| condition_values | A list of condition values that must be in effect for this encounter to occur | list [NamedAPIResource](#namedapiresource) ([EncounterConditionValue](#encounter-condition-values)) | -| chance | percent chance that this encounter will occur | integer | -| method | The method by which this encounter happens | [NamedAPIResource](#namedapiresource) ([EncounterMethod](#encounter-methods)) | - - -#### FlavorText - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| flavor_text | The localized name for an api resource in a specific language | string | -| language | The language this flavor text is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### GenerationGameIndex - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| game_index | The internal id of an api resource within game data | integer | -| generation | The generation relevent to this game index | [NamedAPIResource](#namedapiresource) ([Generation](#generations)) | - -#### Name - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| name | The localized name for an api resource in a specific language | string | -| language | The language this name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### NamedAPIResource - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| name | The name of the referenced resource | string | -| url | The url of the referenced resource | string | - - -#### VerboseEffect - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| effect | The localized effect text for an api resource in a specific language | string | -| short_effect | The localized effect text in brief | string | -| language | The language this effect is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | - - -#### VersionEncounterDetail - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| version | The game version this encounter happens in | [NamedAPIResource](#namedapiresource) ([Version](#versions)) | -| max_chance | The total percentage of all encounter potential | integer | -| encounter_details | A list of encounters and their specifics | list [Encounter](#encounters) | - - -#### VersionGameIndex - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| game_index | The internal id of an api resource within game data | integer | -| version | The version relevant to this game index | [NamedAPIResource](#namedapiresource) ([Version](#versions)) | - - -#### VersionGroupFlavorText - -| Name | Description | Data Type | -| ---- | ----------- | --------- | -| text | The localized name for an api resource in a specific language | string | -| language | The language this name is in | [NamedAPIResource](#namedapiresource) ([Language](#languages)) | -| version_group | The version group which uses this flavor text | [NamedAPIResource](#namedapiresource) ([VersionGroup](#version-groups)) | - - +https://pokeapi.co/docs/v2 diff --git a/pokemon_v2/api.py b/pokemon_v2/api.py index 790f62b93..4d27e2479 100644 --- a/pokemon_v2/api.py +++ b/pokemon_v2/api.py @@ -4,6 +4,9 @@ from rest_framework.views import APIView from django.shortcuts import get_object_or_404 from django.http import Http404 +from django.db.models import Q +from drf_spectacular.utils import extend_schema, extend_schema_view, OpenApiParameter +from drf_spectacular.types import OpenApiTypes from .models import * from .serializers import * @@ -38,6 +41,25 @@ class NameOrIdRetrieval: idPattern = re.compile(r"^-?[0-9]+$") namePattern = re.compile(r"^[0-9A-Za-z\-\+]+$") + def get_queryset(self): + queryset = super().get_queryset() + filter = self.request.GET.get("q", "") + + if filter: + queryset = queryset.filter(Q(name__icontains=filter)) + + return queryset + + @extend_schema( + parameters=[ + OpenApiParameter( + name="id", + description="This parameter can be a string or an integer.", + location=OpenApiParameter.PATH, + type=OpenApiTypes.STR, + ), + ] + ) def get_object(self): queryset = self.get_queryset() queryset = self.filter_queryset(queryset) @@ -70,299 +92,879 @@ class PokeapiCommonViewset( ########## +@extend_schema( + description="Abilities provide passive effects for Pokémon in battle or in the overworld. Pokémon have multiple possible abilities but can have only one ability at a time. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Ability) for greater detail.", + tags=["pokemon"], +) class AbilityResource(PokeapiCommonViewset): queryset = Ability.objects.all() serializer_class = AbilityDetailSerializer list_serializer_class = AbilitySummarySerializer +@extend_schema( + description="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](http://bulbapedia.bulbagarden.net/wiki/Berry) for greater detail.", + tags=["berries"], + summary="Get a berry", +) +@extend_schema_view( + list=extend_schema( + summary="List berries", + ) +) class BerryResource(PokeapiCommonViewset): queryset = Berry.objects.all() serializer_class = BerryDetailSerializer list_serializer_class = BerrySummarySerializer +@extend_schema( + description="Berries can be soft or hard. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Category:Berries_by_firmness) for greater detail.", + tags=["berries"], + summary="Get berry by firmness", +) +@extend_schema_view( + list=extend_schema( + summary="List berry firmness", + ) +) class BerryFirmnessResource(PokeapiCommonViewset): queryset = BerryFirmness.objects.all() serializer_class = BerryFirmnessDetailSerializer list_serializer_class = BerryFirmnessSummarySerializer +@extend_schema( + description="Flavors determine whether a Pokémon will benefit or suffer from eating a berry based on their **nature**. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Flavor) for greater detail.", + summary="Get berries by flavor", + tags=["berries"], +) +@extend_schema_view( + list=extend_schema( + summary="List berry flavors", + ) +) class BerryFlavorResource(PokeapiCommonViewset): queryset = BerryFlavor.objects.all() serializer_class = BerryFlavorDetailSerializer list_serializer_class = BerryFlavorSummarySerializer +@extend_schema( + description="Characteristics indicate which stat contains a Pokémon's highest IV. A Pokémon's Characteristic is determined by the remainder of its highest IV divided by 5 (gene_modulo). Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Characteristic) for greater detail.", + summary="Get characteristic", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List charecterictics", + ) +) class CharacteristicResource(PokeapiCommonViewset): queryset = Characteristic.objects.all() serializer_class = CharacteristicDetailSerializer list_serializer_class = CharacteristicSummarySerializer +@extend_schema( + description="Contest effects refer to the effects of moves when used in contests.", + tags=["contests"], + summary="Get contest effect", +) +@extend_schema_view( + list=extend_schema( + summary="List contest effects", + ) +) class ContestEffectResource(PokeapiCommonViewset): queryset = ContestEffect.objects.all() serializer_class = ContestEffectDetailSerializer list_serializer_class = ContestEffectSummarySerializer +@extend_schema( + description="Contest types are categories judges used to weigh a Pokémon's condition in Pokémon contests. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Contest_condition) for greater detail.", + summary="Get contest type", + tags=["contests"], +) +@extend_schema_view( + list=extend_schema( + summary="List contest types", + ) +) class ContestTypeResource(PokeapiCommonViewset): queryset = ContestType.objects.all() serializer_class = ContestTypeDetailSerializer list_serializer_class = ContestTypeSummarySerializer +@extend_schema( + description="Egg Groups are categories which determine which Pokémon are able to interbreed. Pokémon may belong to either one or two Egg Groups. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Egg_Group) for greater detail.", + summary="Get egg group", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List egg groups", + ) +) class EggGroupResource(PokeapiCommonViewset): queryset = EggGroup.objects.all() serializer_class = EggGroupDetailSerializer list_serializer_class = EggGroupSummarySerializer +@extend_schema( + description="Conditions which affect what pokemon might appear in the wild, e.g., day or night.", + summary="Get encounter condition", + tags=["encounters"], +) +@extend_schema_view( + list=extend_schema( + summary="List encounter conditions", + ) +) class EncounterConditionResource(PokeapiCommonViewset): queryset = EncounterCondition.objects.all() serializer_class = EncounterConditionDetailSerializer list_serializer_class = EncounterConditionSummarySerializer +@extend_schema( + description="Encounter condition values are the various states that an encounter condition can have, i.e., time of day can be either day or night.", + summary="Get encounter condition value", + tags=["encounters"], +) +@extend_schema_view( + list=extend_schema( + summary="List encounter condition values", + ) +) class EncounterConditionValueResource(PokeapiCommonViewset): queryset = EncounterConditionValue.objects.all() serializer_class = EncounterConditionValueDetailSerializer list_serializer_class = EncounterConditionValueSummarySerializer +@extend_schema( + description="Methods by which the player might can encounter Pokémon in the wild, e.g., walking in tall grass. Check out Bulbapedia for greater detail.", + summary="Get encounter method", + tags=["encounters"], +) +@extend_schema_view( + list=extend_schema( + summary="List encounter methods", + ) +) class EncounterMethodResource(PokeapiCommonViewset): queryset = EncounterMethod.objects.all() serializer_class = EncounterMethodDetailSerializer list_serializer_class = EncounterMethodSummarySerializer +@extend_schema( + description="Evolution chains are essentially family trees. They start with the lowest stage within a family and detail evolution conditions for each as well as Pokémon they can evolve into up through the hierarchy.", + summary="Get evolution chain", + tags=["evolution"], +) +@extend_schema_view( + list=extend_schema( + summary="List evolution chains", + ) +) class EvolutionChainResource(PokeapiCommonViewset): queryset = EvolutionChain.objects.all() serializer_class = EvolutionChainDetailSerializer list_serializer_class = EvolutionChainSummarySerializer +@extend_schema( + description="Evolution triggers are the events and conditions that cause a Pokémon to evolve. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Methods_of_evolution) for greater detail.", + summary="Get evolution trigger", + tags=["evolution"], +) +@extend_schema_view( + list=extend_schema( + summary="List evolution triggers", + ) +) class EvolutionTriggerResource(PokeapiCommonViewset): queryset = EvolutionTrigger.objects.all() serializer_class = EvolutionTriggerDetailSerializer list_serializer_class = EvolutionTriggerSummarySerializer +@extend_schema( + description="A generation is a grouping of the Pokémon games that separates them based on the Pokémon they include. In each generation, a new set of Pokémon, Moves, Abilities and Types that did not exist in the previous generation are released.", + summary="Get genration", + tags=["games"], +) +@extend_schema_view( + list=extend_schema( + summary="List genrations", + ) +) class GenerationResource(PokeapiCommonViewset): queryset = Generation.objects.all() serializer_class = GenerationDetailSerializer list_serializer_class = GenerationSummarySerializer +@extend_schema( + description="Genders were introduced in Generation II for the purposes of breeding Pokémon but can also result in visual differences or even different evolutionary lines. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Gender) for greater detail.", + summary="Get gender", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List genders", + ) +) class GenderResource(PokeapiCommonViewset): queryset = Gender.objects.all() serializer_class = GenderDetailSerializer list_serializer_class = GenderSummarySerializer +@extend_schema( + description="Growth rates are the speed with which Pokémon gain levels through experience. Check out [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Experience) for greater detail.", + summary="Get growth rate", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List growth rates", + ) +) class GrowthRateResource(PokeapiCommonViewset): queryset = GrowthRate.objects.all() serializer_class = GrowthRateDetailSerializer list_serializer_class = GrowthRateSummarySerializer +@extend_schema( + description="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.", + summary="Get item", + tags=["items"], +) +@extend_schema_view( + list=extend_schema( + summary="List items", + ) +) class ItemResource(PokeapiCommonViewset): queryset = Item.objects.all() serializer_class = ItemDetailSerializer list_serializer_class = ItemSummarySerializer +@extend_schema( + description="Item categories determine where items will be placed in the players bag.", + summary="Get item category", + tags=["items"], +) +@extend_schema_view( + list=extend_schema( + summary="List item categories", + ) +) class ItemCategoryResource(PokeapiCommonViewset): queryset = ItemCategory.objects.all() serializer_class = ItemCategoryDetailSerializer list_serializer_class = ItemCategorySummarySerializer +@extend_schema( + description='Item attributes define particular aspects of items, e.g."usable in battle" or "consumable".', + summary="Get item attribute", + tags=["items"], +) +@extend_schema_view( + list=extend_schema( + summary="List item attributes", + ) +) class ItemAttributeResource(PokeapiCommonViewset): queryset = ItemAttribute.objects.all() serializer_class = ItemAttributeDetailSerializer list_serializer_class = ItemAttributeSummarySerializer +@extend_schema( + description='The various effects of the move"Fling" when used with different items.', + summary="Get item fling effect", + tags=["items"], +) +@extend_schema_view( + list=extend_schema( + summary="List item fling effects", + ) +) class ItemFlingEffectResource(PokeapiCommonViewset): queryset = ItemFlingEffect.objects.all() serializer_class = ItemFlingEffectDetailSerializer list_serializer_class = ItemFlingEffectSummarySerializer +@extend_schema( + description="Pockets within the players bag used for storing items by category.", + summary="Get item pocket", + tags=["items"], +) +@extend_schema_view( + list=extend_schema( + summary="List item pockets", + ) +) class ItemPocketResource(PokeapiCommonViewset): queryset = ItemPocket.objects.all() serializer_class = ItemPocketDetailSerializer list_serializer_class = ItemPocketSummarySerializer +@extend_schema( + description="Languages for translations of API resource information.", + summary="Get language", + tags=["utility"], +) +@extend_schema_view( + list=extend_schema( + summary="List languages", + ) +) class LanguageResource(PokeapiCommonViewset): queryset = Language.objects.all() serializer_class = LanguageDetailSerializer list_serializer_class = LanguageSummarySerializer +@extend_schema( + description="Locations that can be visited within the games. Locations make up sizable portions of regions, like cities or routes.", + summary="Get location", + tags=["location"], +) +@extend_schema_view( + list=extend_schema( + summary="List locations", + ) +) class LocationResource(PokeapiCommonViewset): queryset = Location.objects.all() serializer_class = LocationDetailSerializer list_serializer_class = LocationSummarySerializer +@extend_schema( + description="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.", + summary="Get location area", + tags=["location"], +) +@extend_schema_view( + list=extend_schema( + summary="List location areas", + ) +) class LocationAreaResource(ListOrDetailSerialRelation, viewsets.ReadOnlyModelViewSet): queryset = LocationArea.objects.all() serializer_class = LocationAreaDetailSerializer list_serializer_class = LocationAreaSummarySerializer +@extend_schema( + description="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.", + summary="Get machine", + tags=["machines"], +) +@extend_schema_view( + list=extend_schema( + summary="List machines", + ) +) class MachineResource(PokeapiCommonViewset): queryset = Machine.objects.all() serializer_class = MachineDetailSerializer list_serializer_class = MachineSummarySerializer +@extend_schema( + description="Moves are the skills of Pokémon in battle. In battle, a Pokémon uses one move each turn. Some moves (including those learned by Hidden Machine) can be used outside of battle as well, usually for the purpose of removing obstacles or exploring new areas.", + summary="Get move", + tags=["moves"], +) +@extend_schema_view( + list=extend_schema( + summary="List moves", + ) +) class MoveResource(PokeapiCommonViewset): queryset = Move.objects.all() serializer_class = MoveDetailSerializer list_serializer_class = MoveSummarySerializer +@extend_schema( + description="Damage classes moves can have, e.g. physical, special, or non-damaging.", + summary="Get move damage class", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List move damage classes", + ) +) class MoveDamageClassResource(PokeapiCommonViewset): queryset = MoveDamageClass.objects.all() serializer_class = MoveDamageClassDetailSerializer list_serializer_class = MoveDamageClassSummarySerializer +@extend_schema( + description="Move Ailments are status conditions caused by moves used during battle. See [Bulbapedia](https://bulbapedia.bulbagarden.net/wiki/Status_condition) for greater detail.", + summary="Get move meta ailment", + tags=["moves"], +) +@extend_schema_view( + list=extend_schema( + summary="List move meta ailments", + ) +) class MoveMetaAilmentResource(PokeapiCommonViewset): queryset = MoveMetaAilment.objects.all() serializer_class = MoveMetaAilmentDetailSerializer list_serializer_class = MoveMetaAilmentSummarySerializer +@extend_schema( + description="Styles of moves when used in the Battle Palace. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Battle_Frontier_(Generation_III)) for greater detail.", + summary="Get move battle style", + tags=["moves"], +) +@extend_schema_view( + list=extend_schema( + summary="List move battle styles", + ) +) class MoveBattleStyleResource(PokeapiCommonViewset): queryset = MoveBattleStyle.objects.all() serializer_class = MoveBattleStyleDetailSerializer list_serializer_class = MoveBattleStyleSummarySerializer +@extend_schema( + description="Very general categories that loosely group move effects.", + summary="Get move meta category", + tags=["moves"], +) +@extend_schema_view( + list=extend_schema( + summary="List move meta categories", + ) +) class MoveMetaCategoryResource(PokeapiCommonViewset): queryset = MoveMetaCategory.objects.all() serializer_class = MoveMetaCategoryDetailSerializer list_serializer_class = MoveMetaCategorySummarySerializer +@extend_schema( + description="Methods by which Pokémon can learn moves.", + summary="Get move learn method", + tags=["moves"], +) +@extend_schema_view( + list=extend_schema( + summary="List move learn methods", + ) +) class MoveLearnMethodResource(PokeapiCommonViewset): queryset = MoveLearnMethod.objects.all() serializer_class = MoveLearnMethodDetailSerializer list_serializer_class = MoveLearnMethodSummarySerializer +@extend_schema( + description="Targets moves can be directed at during battle. Targets can be Pokémon, environments or even other moves.", + summary="Get move target", + tags=["moves"], +) +@extend_schema_view( + list=extend_schema( + summary="List move targets", + ) +) class MoveTargetResource(PokeapiCommonViewset): queryset = MoveTarget.objects.all() serializer_class = MoveTargetDetailSerializer list_serializer_class = MoveTargetSummarySerializer +@extend_schema( + description="Natures influence how a Pokémon's stats grow. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Nature) for greater detail.", + summary="Get nature", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List natures", + ) +) class NatureResource(PokeapiCommonViewset): queryset = Nature.objects.all() serializer_class = NatureDetailSerializer list_serializer_class = NatureSummarySerializer +@extend_schema( + description="Areas used for grouping Pokémon encounters in Pal Park. They're like habitats that are specific to Pal Park.", + summary="Get pal park area", + tags=["location"], +) +@extend_schema_view( + list=extend_schema( + summary="List pal park areas", + ) +) class PalParkAreaResource(PokeapiCommonViewset): queryset = PalParkArea.objects.all() serializer_class = PalParkAreaDetailSerializer list_serializer_class = PalParkAreaSummarySerializer +@extend_schema( + description="Pokeathlon Stats are different attributes of a Pokémon's performance in Pokéathlons. In Pokéathlons, competitions happen on different courses; one for each of the different Pokéathlon stats. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9athlon) for greater detail.", + summary="Get pokeathlon stat", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokeathlon stats", + ) +) class PokeathlonStatResource(PokeapiCommonViewset): queryset = PokeathlonStat.objects.all() serializer_class = PokeathlonStatDetailSerializer list_serializer_class = PokeathlonStatSummarySerializer +@extend_schema( + description="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](http://bulbapedia.bulbagarden.net/wiki/Pokedex) for greater detail.", + summary="Get pokedex", + tags=["games"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokedex", + ) +) class PokedexResource(PokeapiCommonViewset): queryset = Pokedex.objects.all() serializer_class = PokedexDetailSerializer list_serializer_class = PokedexSummarySerializer +@extend_schema( + description="Colors used for sorting Pokémon in a Pokédex. The color listed in the Pokédex is usually the color most apparent or covering each Pokémon's body. No orange category exists; Pokémon that are primarily orange are listed as red or brown.", + summary="Get pokemon color", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokemon colors", + ) +) class PokemonColorResource(PokeapiCommonViewset): queryset = PokemonColor.objects.all() serializer_class = PokemonColorDetailSerializer list_serializer_class = PokemonColorSummarySerializer +@extend_schema( + description="Some Pokémon may appear in one of multiple, visually different forms. These differences are purely cosmetic. For variations within a Pokémon species, which do differ in more than just visuals, the 'Pokémon' entity is used to represent such a variety.", + summary="Get pokemon form", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokemon forms", + ) +) class PokemonFormResource(PokeapiCommonViewset): queryset = PokemonForm.objects.all() serializer_class = PokemonFormDetailSerializer list_serializer_class = PokemonFormSummarySerializer +@extend_schema( + description="Habitats are generally different terrain Pokémon can be found in but can also be areas designated for rare or legendary Pokémon.", + summary="Get pokemom habita", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokemom habitas", + ) +) class PokemonHabitatResource(PokeapiCommonViewset): queryset = PokemonHabitat.objects.all() serializer_class = PokemonHabitatDetailSerializer list_serializer_class = PokemonHabitatSummarySerializer +@extend_schema( + description="Shapes used for sorting Pokémon in a Pokédex.", + summary="Get pokemon shape", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokemon shapes", + ) +) class PokemonShapeResource(PokeapiCommonViewset): queryset = PokemonShape.objects.all() serializer_class = PokemonShapeDetailSerializer list_serializer_class = PokemonShapeSummarySerializer +@extend_schema( + description="Pokémon are the creatures that inhabit the world of the Pokémon games. They can be caught using Pokéballs and trained by battling with other Pokémon. Each Pokémon belongs to a specific species but may take on a variant which makes it differ from other Pokémon of the same species, such as base stats, available abilities and typings. See [Bulbapedia](http://bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_(species)) for greater detail.", + summary="Get pokemon", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokemon", + ) +) class PokemonResource(PokeapiCommonViewset): queryset = Pokemon.objects.all() serializer_class = PokemonDetailSerializer list_serializer_class = PokemonSummarySerializer +@extend_schema( + description="A Pokémon Species forms the basis for at least one Pokémon. Attributes of a Pokémon species are shared across all varieties of Pokémon within the species. A good example is Wormadam; Wormadam is the species which can be found in three different varieties, Wormadam-Trash, Wormadam-Sandy and Wormadam-Plant.", + summary="Get pokemon species", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List pokemon species", + ) +) class PokemonSpeciesResource(PokeapiCommonViewset): queryset = PokemonSpecies.objects.all().order_by("id") serializer_class = PokemonSpeciesDetailSerializer list_serializer_class = PokemonSpeciesSummarySerializer +@extend_schema( + description="A region is an organized area of the Pokémon world. Most often, the main difference between regions is the species of Pokémon that can be encountered within them.", + summary="Get region", + tags=["location"], +) +@extend_schema_view( + list=extend_schema( + summary="List regions", + ) +) class RegionResource(PokeapiCommonViewset): queryset = Region.objects.all() serializer_class = RegionDetailSerializer list_serializer_class = RegionSummarySerializer +@extend_schema( + description="Stats determine certain aspects of battles. Each Pokémon has a value for each stat which grows as they gain levels and can be altered momentarily by effects in battles.", + summary="Get stat", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List stats", + ) +) class StatResource(PokeapiCommonViewset): queryset = Stat.objects.all() serializer_class = StatDetailSerializer list_serializer_class = StatSummarySerializer +@extend_schema( + description="Super contest effects refer to the effects of moves when used in super contests.", + summary="Get super contest effect", + tags=["contests"], +) +@extend_schema_view( + list=extend_schema( + summary="List super contest effects", + ) +) class SuperContestEffectResource(PokeapiCommonViewset): queryset = SuperContestEffect.objects.all() serializer_class = SuperContestEffectDetailSerializer list_serializer_class = SuperContestEffectSummarySerializer +@extend_schema( + description="Types are properties for Pokémon and their moves. Each type has three properties: which types of Pokémon it is super effective against, which types of Pokémon it is not very effective against, and which types of Pokémon it is completely ineffective against.", + summary="Get types", + tags=["pokemon"], +) +@extend_schema_view( + list=extend_schema( + summary="List types", + ) +) class TypeResource(PokeapiCommonViewset): queryset = Type.objects.all() serializer_class = TypeDetailSerializer list_serializer_class = TypeSummarySerializer +@extend_schema( + description="Versions of the games, e.g., Red, Blue or Yellow.", + summary="Get version", + tags=["games"], +) +@extend_schema_view( + list=extend_schema( + summary="List versions", + ) +) class VersionResource(PokeapiCommonViewset): queryset = Version.objects.all() serializer_class = VersionDetailSerializer list_serializer_class = VersionSummarySerializer +@extend_schema( + description="Version groups categorize highly similar versions of the games.", + summary="Get version group", + tags=["games"], +) +@extend_schema_view( + list=extend_schema( + summary="List version groups", + ) +) class VersionGroupResource(PokeapiCommonViewset): queryset = VersionGroup.objects.all() serializer_class = VersionGroupDetailSerializer list_serializer_class = VersionGroupSummarySerializer +@extend_schema( + description="Handles Pokemon Encounters as a sub-resource.", + summary="Get pokemon encounter", + tags=["encounters"], + responses={ + "200": { + "type": "array", + "items": { + "type": "object", + "required": ["location_area", "version_details"], + "properties": { + "location_area": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "cerulean-city-area"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/location-area/281/", + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["encounter_details", "max_chance", "version"], + "properties": { + "encounter_details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "chance", + "condition_values", + "max_level", + "method", + "min_level", + ], + "properties": { + "chance": { + "type": "number", + "example": 100, + }, + "condition_values": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "story-progress-beat-red", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/encounter-condition-value/55/", + }, + }, + }, + }, + "max_level": { + "type": "number", + "example": 10, + }, + "method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "example": "gift", + }, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/encounter-method/18/", + }, + }, + }, + "min_level": { + "type": "number", + "example": 10, + }, + }, + }, + }, + "max_chance": {"type": "number", "example": 100}, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "example": "red"}, + "url": { + "type": "string", + "format": "uri", + "example": "https://pokeapi.co/api/v2/version/1/", + }, + }, + }, + }, + }, + }, + }, + }, + } + }, +) class PokemonEncounterView(APIView): - """ - Handles Pokemon Encounters as a sub-resource. - """ - def get(self, request, pokemon_id): self.context = dict(request=request) diff --git a/pokemon_v2/serializers.py b/pokemon_v2/serializers.py index cef6f6b13..3b5df51f6 100644 --- a/pokemon_v2/serializers.py +++ b/pokemon_v2/serializers.py @@ -2,6 +2,7 @@ import json from django.urls import reverse from rest_framework import serializers +from drf_spectacular.utils import extend_schema_field # pylint: disable=redefined-builtin @@ -477,6 +478,16 @@ class Meta: "descriptions", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "integer", + "format": "int32", + }, + "examples": [[0, 5, 10, 15, 20, 25, 30]], + } + ) def get_values(self, obj): mod = obj.gene_mod_5 values = [] @@ -609,6 +620,23 @@ class Meta: "version_groups", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["red-blue"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/version-group/1/"], + }, + }, + }, + } + ) def get_region_version_groups(self, obj): vg_regions = VersionGroupRegion.objects.filter(region=obj) data = VersionGroupRegionSerializer( @@ -676,6 +704,32 @@ class Meta: model = Gender fields = ("id", "name", "pokemon_species_details", "required_for_evolution") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["rate", "pokemon_species"], + "properties": { + "rate": {"type": "integer", "format": "int32", "examples": [1]}, + "pokemon_species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bulbasaur"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/1/" + ], + }, + }, + }, + }, + }, + } + ) def get_species(self, obj): species_objects = [] @@ -698,6 +752,23 @@ def get_species(self, obj): return details + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["wormadam"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokemon-species/413/"], + }, + }, + }, + } + ) def get_required(self, obj): evo_objects = PokemonEvolution.objects.filter(gender=obj) species_list = [] @@ -907,6 +978,62 @@ class Meta: "pokemon_encounters", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["encounter_method", "version_details"], + "properties": { + "encounter_method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["old-rod"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/encounter-method/2/" + ], + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["rate", "version"], + "properties": { + "rate": { + "type": "integer", + "format": "int32", + "examples": [5], + }, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["platinum"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version/14/" + ], + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_method_rates(self, obj): # Get encounters related to this area and pull out unique encounter methods encounter_rates = LocationAreaEncounterRate.objects.filter( @@ -948,6 +1075,121 @@ def get_method_rates(self, obj): return encounter_rate_list + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["pokemon", "version_details"], + "properties": { + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["tentacool"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokemon/72/"], + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["version", "max_chance", "encounter_details"], + "properties": { + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["diamond"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version/12/" + ], + }, + }, + }, + "max_chance": { + "type": "integer", + "format": "int32", + "examples": [60], + }, + "encounter_details": { + "type": "object", + "required": [ + "min_level", + "max_level", + "condition_value", + "chance", + "method", + ], + "properties": { + "min_level": { + "type": "integer", + "format": "int32", + "examples": [20], + }, + "max_level": { + "type": "integer", + "format": "int32", + "examples": [30], + }, + "condition_values": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["slot2-sapphire"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/encounter-condition-value/10/" + ], + }, + }, + }, + "chance": { + "type": "integer", + "format": "int32", + "examples": [60], + }, + "method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["surf"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/encounter-method/5/" + ], + }, + }, + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_encounters(self, obj): # get versions for later use version_objects = Version.objects.all() @@ -1119,6 +1361,31 @@ class Meta: "pokemon", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["is_hidden", "slot", "pokemon"], + "properties": { + "is_hidden": {"type": "boolean"}, + "slot": {"type": "integer", "format": "int32", "examples": [3]}, + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["gloom"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokemon/44/"], + }, + }, + }, + }, + }, + } + ) def get_ability_pokemon(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(ability=obj) data = PokemonAbilitySerializer( @@ -1169,6 +1436,73 @@ class Meta: "names", ) + @extend_schema_field( + field={ + "type": "object", + "required": ["decrease", "increase"], + "properties": { + "increase": { + "type": "array", + "items": { + "type": "object", + "required": ["change", "move"], + "properties": { + "change": { + "type": "integer", + "format": "int32", + "examples": [-1], + }, + "move": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["swords-dance"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/move/14/" + ], + }, + }, + }, + }, + }, + }, + "decrease": { + "type": "array", + "items": { + "type": "object", + "required": ["change", "move"], + "properties": { + "change": { + "type": "integer", + "format": "int32", + "examples": [5], + }, + "move": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["growl"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/move/45/" + ], + }, + }, + }, + }, + }, + }, + }, + } + ) def get_moves_that_affect(self, obj): stat_change_objects = MoveMetaStatChange.objects.filter(stat=obj) stat_changes = MoveMetaStatChangeSerializer( @@ -1185,6 +1519,44 @@ def get_moves_that_affect(self, obj): return changes + @extend_schema_field( + field={ + "type": "object", + "required": ["increase", "decrease"], + "properties": { + "increase": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["lonely"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/nature/6/"], + }, + }, + }, + }, + "decrease": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bold"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/nature/2/"], + }, + }, + }, + }, + }, + } + ) def get_natures_that_affect(self, obj): increase_objects = Nature.objects.filter(increased_stat=obj) increases = NatureSummarySerializer( @@ -1279,6 +1651,23 @@ class Meta: model = ItemAttribute fields = ("id", "name", "descriptions", "items", "names") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["master-ball"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/item/1/"], + }, + }, + }, + } + ) def get_attribute_items(self, obj): item_map_objects = ItemAttributeMap.objects.filter(item_attribute=obj) items = [] @@ -1395,6 +1784,36 @@ class Meta: "machines", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["machine", "version_group"], + "properties": { + "machine": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/machine/1/"], + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["sword-shield"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version-group/20/" + ], + }, + }, + }, + }, + }, + } + ) def get_item_machines(self, obj): machine_objects = Machine.objects.filter(item=obj) @@ -1415,10 +1834,42 @@ def get_item_machines(self, obj): return machines + @extend_schema_field( + field={ + "type": "object", + "required": ["default"], + "properties": { + "default": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/media/sprites/items/master-ball.png" + ], + } + }, + } + ) def get_item_sprites(self, obj): sprites_object = ItemSprites.objects.get(item_id=obj) return sprites_object.sprites + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["countable"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/item-attribute/1/"], + }, + }, + }, + } + ) def get_item_attributes(self, obj): item_attribute_maps = ItemAttributeMap.objects.filter(item=obj) serializer = ItemAttributeMapSerializer( @@ -1436,6 +1887,60 @@ def get_item_attributes(self, obj): return attributes + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["pokemon", "version-details"], + "properties": { + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["farfetchd"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokemon/83/"], + }, + }, + }, + "version-details": { + "type": "array", + "items": { + "type": "object", + "required": ["rarity", "version"], + "properties": { + "rarity": { + "type": "integer", + "format": "int32", + "examples": [5], + }, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["ruby"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version/7/" + ], + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_held_by_pokemon(self, obj): pokemon_items = PokemonItem.objects.filter(item=obj).order_by("pokemon_id") pokemon_ids = pokemon_items.values("pokemon_id").distinct() @@ -1468,6 +1973,19 @@ def get_held_by_pokemon(self, obj): return pokemon_list + @extend_schema_field( + field={ + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/evolution-chain/51/"], + } + }, + } + ) def get_baby_trigger_for(self, obj): try: chain_object = EvolutionChain.objects.get(baby_trigger_item=obj) @@ -1532,6 +2050,36 @@ class Meta: "names", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["max_change", "pokeathlon_stat"], + "properties": { + "max_change": { + "type": "integer", + "format": "int32", + "examples": [1], + }, + "pokeathlon_stat": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["power"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/pokeathlon-stat/2/" + ], + }, + }, + }, + }, + }, + } + ) def get_pokeathlon_stats(self, obj): pokeathlon_stat_objects = NaturePokeathlonStat.objects.filter(nature=obj) pokeathlon_stats = NaturePokeathlonStatSerializer( @@ -1587,6 +2135,35 @@ class Meta: model = BerryFlavor fields = ("id", "name", "berries", "contest_type", "names") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "berry"], + "properties": { + "potency": {"type": "integer", "examples": [10]}, + "berry": { + "type": "object", + "require": ["name", "url"], + "properties": { + "name": { + "type": "string", + "description": "The name of the berry", + "examples": ["rowap"], + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the berry", + "examples": ["https://pokeapi.co/api/v2/berry/64/"], + }, + }, + }, + }, + }, + } + ) def get_berries_with_flavor(self, obj): flavor_map_objects = BerryFlavorMap.objects.filter( berry_flavor=obj, potency__gt=0 @@ -1624,6 +2201,37 @@ class Meta: "natural_gift_type", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "flavor"], + "properties": { + "potency": {"type": "integer", "examples": [10]}, + "flavor": { + "type": "object", + "require": ["name", "url"], + "properties": { + "name": { + "type": "string", + "description": "The name of the flavor", + "examples": ["spicy"], + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the flavor", + "examples": [ + "https://pokeapi.co/api/v2/berry-flavor/1/" + ], + }, + }, + }, + }, + }, + } + ) def get_berry_flavors(self, obj): flavor_map_objects = BerryFlavorMap.objects.filter(berry=obj) flavor_maps = BerryFlavorMapSerializer( @@ -1666,6 +2274,28 @@ class Meta: model = EggGroup fields = ("id", "name", "names", "pokemon_species") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "flavor"], + "properties": { + "name": { + "type": "string", + "description": "Pokemon species name.", + "examples": ["bulbasaur"], + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the species", + "examples": ["https://pokeapi.co/api/v2/pokemon-species/1/"], + }, + }, + }, + } + ) def get_species(self, obj): results = PokemonEggGroup.objects.filter(egg_group=obj) data = PokemonEggGroupSerializer(results, many=True, context=self.context).data @@ -1745,6 +2375,7 @@ class Meta: # adds an entry for the given type with the given damage # factor in the given direction to the set of relations + def add_type_entry(self, relations, type, damage_factor, direction="_damage_to"): if damage_factor == 200: relations["double" + direction].append( @@ -1759,6 +2390,111 @@ def add_type_entry(self, relations, type, damage_factor, direction="_damage_to") TypeSummarySerializer(type, context=self.context).data ) + @extend_schema_field( + field={ + "type": "object", + "required": [ + "no_damage_to", + "half_damage_to", + "double_damage_to", + "no_damage_from", + "half_damage_from", + "double_damage_from", + ], + "properties": { + "no_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["flying"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/3/"], + }, + }, + }, + }, + "half_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bug"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/7/"], + }, + }, + }, + }, + "double_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["poison"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/4/"], + }, + }, + }, + }, + "no_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["electric"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/13/"], + }, + }, + }, + }, + "half_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["poison"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/4/"], + }, + }, + }, + }, + "double_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["water"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/11/"], + }, + }, + }, + }, + }, + } + ) def get_type_relationships(self, obj): relations = OrderedDict() relations["no_damage_to"] = [] @@ -1823,6 +2559,159 @@ def remove_type_entry(self, relations, type, direction="_damage_to"): return # returns past type relationships for the given type object + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["generation", "damage_relations"], + "properties": { + "generation": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["generation-v"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/generation/5/"], + }, + }, + }, + "damage_relations": { + "type": "object", + "required": [ + "no_damage_to", + "half_damage_to", + "double_damage_to", + "no_damage_from", + "half_damage_from", + "double_damage_from", + ], + "properties": { + "no_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["flying"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/type/3/" + ], + }, + }, + }, + }, + "half_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bug"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/type/7/" + ], + }, + }, + }, + }, + "double_damage_to": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["poison"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/type/4/" + ], + }, + }, + }, + }, + "no_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["electric"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/type/13/" + ], + }, + }, + }, + }, + "half_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["poison"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/type/4/" + ], + }, + }, + }, + }, + "double_damage_from": { + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["water"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/type/11/" + ], + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_type_past_relationships(self, obj): # collect data from DB damage_type_results = list(TypeEfficacyPast.objects.filter(damage_type=obj)) @@ -1917,6 +2806,35 @@ def type_is_present(self, type, current_gen): gen_introduced = Generation.objects.get(pk=type_obj.generation.id) return gen_introduced.id <= current_gen.id + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["potency", "flavor"], + "properties": { + "slot": {"type": "integer", "examples": [1]}, + "pokemon": { + "type": "object", + "require": ["name", "url"], + "properties": { + "name": { + "type": "string", + "description": "The name of the pokemon", + "examples": ["sandshrew"], + }, + "url": { + "type": "string", + "format": "uri", + "description": "The URL to get more information about the pokemon", + "examples": ["https://pokeapi.co/api/v2/pokemon/27/"], + }, + }, + }, + }, + }, + } + ) def get_type_pokemon(self, obj): poke_type_objects = PokemonType.objects.filter(type=obj) poke_types = PokemonTypeSerializer( @@ -2023,6 +2941,23 @@ class Meta: model = MoveMetaAilment fields = ("id", "name", "moves", "names") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["thunder-punch"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/move/9/"], + }, + }, + }, + } + ) def get_ailment_moves(self, obj): move_meta_objects = MoveMeta.objects.filter(move_meta_ailment=obj) moves = [] @@ -2053,6 +2988,23 @@ class Meta: model = MoveMetaCategory fields = ("id", "name", "descriptions", "moves") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["sing"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/move/47/"], + }, + }, + }, + } + ) def get_category_moves(self, obj): move_meta_objects = MoveMeta.objects.filter(move_meta_category=obj) moves = [] @@ -2147,6 +3099,41 @@ class Meta: "version_group", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["effect", "short_effect", "language"], + "properties": { + "effect": { + "type": "string", + "examples": [ + "Inflicts [regular damage]{mechanic:regular-damage}." + ], + }, + "short_effect": { + "type": "string", + "examples": [ + "Inflicts regular damage with no additional effect." + ], + }, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + }, + }, + }, + }, + } + ) def get_effects(self, obj): effect_texts = MoveEffectEffectText.objects.filter(move_effect=obj.move_effect) data = MoveEffectEffectTextSerializer( @@ -2244,6 +3231,23 @@ class Meta: "learned_by_pokemon", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["clefairy"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokemon/35/"], + }, + }, + }, + } + ) def get_learned_by_pokemon(self, obj): pokemon_moves = PokemonMove.objects.filter(move_id=obj).order_by("pokemon_id") @@ -2261,6 +3265,42 @@ def get_learned_by_pokemon(self, obj): return pokemon_list + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["machine", "version_group"], + "properties": { + "machine": { + "type": "object", + "required": ["url"], + "properties": { + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/machine/1/"], + } + }, + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["sword-shield"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version-group/1/" + ], + }, + }, + }, + }, + }, + } + ) def get_move_machines(self, obj): machine_objects = Machine.objects.filter(move=obj) @@ -2281,6 +3321,110 @@ def get_move_machines(self, obj): return machines + @extend_schema_field( + field={ + "type": "object", + "required": ["normal", "super"], + "properties": { + "normal": { + "type": "object", + "required": ["use_before", "use_after"], + "properties": { + "use_before": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["fire-punch"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/move/7/" + ], + }, + }, + }, + }, + "use_after": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["ice-punch"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/move/8/" + ], + }, + }, + }, + }, + }, + }, + "super": { + "type": "object", + "required": ["use_before", "use_after"], + "properties": { + "use_before": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["night-slash"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/move/400/" + ], + }, + }, + }, + }, + "use_after": { + "type": "array", + "nullable": True, + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["focus-energy"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/move/116/" + ], + }, + }, + }, + }, + }, + }, + }, + } + ) def get_combos(self, obj): normal_before_objects = ContestCombo.objects.filter(first_move=obj) normal_before_data = ContestComboSerializer( @@ -2338,6 +3482,41 @@ def get_combos(self, obj): return details + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["effect", "short_effect", "language"], + "properties": { + "effect": { + "type": "string", + "examples": [ + "Inflicts [regular damage]{mechanic:regular-damage}." + ], + }, + "short_effect": { + "type": "string", + "examples": [ + "Inflicts regular damage with no additional effect." + ], + }, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + }, + }, + }, + }, + } + ) def get_effect_text(self, obj): effect_texts = MoveEffectEffectText.objects.filter(move_effect=obj.move_effect) data = MoveEffectEffectTextSerializer( @@ -2352,6 +3531,60 @@ def get_effect_text(self, obj): return data + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["effect_entries", "version_group"], + "properties": { + "effect_entries": { + "type": "array", + "items": { + "type": "object", + "required": ["effect", "language"], + "properties": { + "effect": { + "type": "string", + "examples": [ + "Hits Pokémon under the effects of dig and fly." + ], + }, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/language/9/" + ], + }, + }, + }, + }, + }, + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["gold-silver"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version-group/3/" + ], + }, + }, + }, + }, + }, + } + ) def get_effect_change_text(self, obj): effect_changes = MoveEffectChange.objects.filter(move_effect=obj.move_effect) data = MoveEffectChangeSerializer( @@ -2360,6 +3593,30 @@ def get_effect_change_text(self, obj): return data + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["change", "stat"], + "properties": { + "change": {"type": "integer", "format": "int32", "examples": [2]}, + "stat": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["attack"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/stat/1/"], + }, + }, + }, + }, + }, + } + ) def get_move_stat_change(self, obj): stat_change_objects = MoveMetaStatChange.objects.filter(move=obj) stat_changes = MoveMetaStatChangeSerializer( @@ -2404,6 +3661,37 @@ class Meta: model = PalParkArea fields = ("id", "name", "names", "pokemon_encounters") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["base_score", "pokemon-species", "rate"], + "properties": { + "base_score": { + "type": "integer", + "format": "int32", + "examples": [50], + }, + "pokemon-species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bulbasaur"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/1/" + ], + }, + }, + }, + "rate": {"type": "integer", "format": "int32", "examples": [30]}, + }, + }, + } + ) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pal_park_area=obj) parks = PalParkSerializer( @@ -2488,6 +3776,30 @@ class Meta: "types", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["language", "name"], + "properties": { + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + }, + }, + "name": {"type": "string", "examples": ["Plant Cloak"]}, + }, + }, + } + ) def get_pokemon_form_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, name__regex=".+" @@ -2503,6 +3815,30 @@ def get_pokemon_form_names(self, obj): return data + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["language", "name"], + "properties": { + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + }, + }, + "name": {"type": "string", "examples": ["Plant Cloak"]}, + }, + }, + } + ) def get_pokemon_form_pokemon_names(self, obj): form_results = PokemonFormName.objects.filter( pokemon_form=obj, pokemon_name__regex=".+" @@ -2519,10 +3855,68 @@ def get_pokemon_form_pokemon_names(self, obj): return data + @extend_schema_field( + field={ + "type": "object", + "properties": { + "default": { + "type": "string", + "format": "uri", + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png" + ], + } + }, + "additionalProperties": { # Stoplight Elements doesn't render this well + "type": "string", + "format": "uri", + "nullable": True, + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png" + ], + }, + "examples": [ + { + "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/412.png", + "back_female": None, + "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/412.png", + "back_shiny_female": None, + "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/412.png", + "front_female": None, + "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/412.png", + "front_shiny_female": None, + } + ], + } + ) def get_pokemon_form_sprites(self, obj): sprites_object = PokemonFormSprites.objects.get(pokemon_form_id=obj) return sprites_object.sprites + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["slot", "type"], + "properties": { + "slot": {"type": "integer", "format": "int32", "examples": [1]}, + "type": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bug"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/7/"], + }, + }, + }, + }, + }, + } + ) def get_pokemon_form_types(self, obj): form_type_objects = PokemonFormType.objects.filter(pokemon_form=obj) form_types = PokemonFormTypeSerializer( @@ -2606,6 +4000,29 @@ class Meta: model = MoveLearnMethod fields = ("id", "name", "names", "descriptions", "version_groups") + # "version_groups": [ + # { + # "name": "red-blue", + # "url": "https://pokeapi.co/api/v2/version-group/1/" + # }, + + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["red-blue"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/version-group/1/"], + }, + }, + }, + } + ) def get_method_version_groups(self, obj): version_group_objects = VersionGroupMoveLearnMethod.objects.filter( move_learn_method=obj @@ -2650,6 +4067,23 @@ class Meta: model = PokemonShape fields = ("id", "name", "awesome_names", "names", "pokemon_species") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["url", "name"], + "properties": { + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + "name": {"type": "string", "examples": ["Ball"]}, + }, + }, + } + ) def get_shape_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( @@ -2662,6 +4096,46 @@ def get_shape_names(self, obj): return data + # "awesome_names": [ + # { + # "awesome_name": "Pomacé", + # "language": { + # "name": "fr", + # "url": "https://pokeapi.co/api/v2/language/5/" + # } + # }, + # { + # "awesome_name": "Pomaceous", + # "language": { + # "name": "en", + # "url": "https://pokeapi.co/api/v2/language/9/" + # } + # } + # ], + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["awesome_name", "language"], + "properties": { + "awesome_name": {"type": "string", "examples": ["Pomaceous"]}, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + }, + }, + }, + }, + } + ) def get_shape_awesome_names(self, obj): results = PokemonShapeName.objects.filter(pokemon_shape_id=obj) serializer = PokemonShapeNameSerializer( @@ -2755,14 +4229,410 @@ class Meta: "past_types", ) + @extend_schema_field( + field={ + "type": "object", + "properties": { + "front_default": { + "type": "string", + "format": "uri", + "exmaple": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", + } + }, + "additionalProperties": { # Stoplight Elements doesn't render this well + "type": "string", + "format": "uri", + "nullable": True, + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png" + ], + }, + "examples": [ + { + "back_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/1.png", + "back_female": None, + "back_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/back/shiny/1.png", + "back_shiny_female": None, + "front_default": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/1.png", + "front_female": None, + "front_shiny": "https://raw.githubusercontent.com/PokeAPI/sprites/master/sprites/pokemon/shiny/1.png", + "front_shiny_female": None, + } + ], + } + ) def get_pokemon_sprites(self, obj): sprites_object = PokemonSprites.objects.get(pokemon_id=obj) return sprites_object.sprites + @extend_schema_field( + field={ + "type": "object", + "required": ["latest", "legacy"], + "properties": { + "latest": { + "type": "string", + "format": "uri", + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/latest/50.ogg" + ], + }, + "legacy": { + "type": "string", + "format": "uri", + "examples": [ + "https://raw.githubusercontent.com/PokeAPI/cries/main/cries/pokemon/legacy/50.ogg" + ], + }, + }, + } + ) def get_pokemon_cries(self, obj): cries_object = PokemonCries.objects.get(pokemon_id=obj) return cries_object.cries + # { + # "move": { + # "name": "scratch", + # "url": "https://pokeapi.co/api/v2/move/10/" + # }, + # "version_group_details": [ + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "red-blue", + # "url": "https://pokeapi.co/api/v2/version-group/1/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "yellow", + # "url": "https://pokeapi.co/api/v2/version-group/2/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "gold-silver", + # "url": "https://pokeapi.co/api/v2/version-group/3/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "crystal", + # "url": "https://pokeapi.co/api/v2/version-group/4/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "ruby-sapphire", + # "url": "https://pokeapi.co/api/v2/version-group/5/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "emerald", + # "url": "https://pokeapi.co/api/v2/version-group/6/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "firered-leafgreen", + # "url": "https://pokeapi.co/api/v2/version-group/7/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "diamond-pearl", + # "url": "https://pokeapi.co/api/v2/version-group/8/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "platinum", + # "url": "https://pokeapi.co/api/v2/version-group/9/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "heartgold-soulsilver", + # "url": "https://pokeapi.co/api/v2/version-group/10/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "black-white", + # "url": "https://pokeapi.co/api/v2/version-group/11/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "colosseum", + # "url": "https://pokeapi.co/api/v2/version-group/12/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "xd", + # "url": "https://pokeapi.co/api/v2/version-group/13/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "black-2-white-2", + # "url": "https://pokeapi.co/api/v2/version-group/14/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "x-y", + # "url": "https://pokeapi.co/api/v2/version-group/15/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "omega-ruby-alpha-sapphire", + # "url": "https://pokeapi.co/api/v2/version-group/16/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "sun-moon", + # "url": "https://pokeapi.co/api/v2/version-group/17/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "ultra-sun-ultra-moon", + # "url": "https://pokeapi.co/api/v2/version-group/18/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "lets-go-pikachu-lets-go-eevee", + # "url": "https://pokeapi.co/api/v2/version-group/19/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "sword-shield", + # "url": "https://pokeapi.co/api/v2/version-group/20/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "brilliant-diamond-and-shining-pearl", + # "url": "https://pokeapi.co/api/v2/version-group/23/" + # } + # }, + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "scarlet-violet", + # "url": "https://pokeapi.co/api/v2/version-group/25/" + # } + # } + # ] + # }, + + # "move": { + # "name": "scratch", + # "url": "https://pokeapi.co/api/v2/move/10/" + # }, + # "version_group_details": [ + # { + # "level_learned_at": 1, + # "move_learn_method": { + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + # }, + # "version_group": { + # "name": "red-blue", + # "url": "https://pokeapi.co/api/v2/version-group/1/" + # } + # }, + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["move", "version_group_details"], + "properties": { + "move": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["scratch"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/move/10/"], + }, + }, + }, + "version_group_details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "level_learned_at", + "move_learn_method", + "version_group", + ], + "properties": { + "level_learned_at": { + "type": "integer", + "format": "int32", + "examples": [1], + }, + "move_learn_method": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["level-up"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/move-learn-method/1/" + ], + }, + }, + }, + "version_group": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["red-blue"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version-group/1/" + ], + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_pokemon_moves(self, obj): version_objects = VersionGroup.objects.all() version_data = VersionGroupSummarySerializer( @@ -2814,6 +4684,67 @@ def get_pokemon_moves(self, obj): return move_list + # { + # "item": { + # "name": "soft-sand", + # "url": "https://pokeapi.co/api/v2/item/214/" + # }, + # "version_details": [ + # { + # "rarity": 5, + # "version": { + # "name": "diamond", + # "url": "https://pokeapi.co/api/v2/version/12/" + # } + # }, + @extend_schema_field( + field={ + "type": "object", + "required": ["item", "version_details"], + "properties": { + "item": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["soft-sand"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/item/214/"], + }, + }, + }, + "version_details": { + "type": "array", + "items": { + "type": "object", + "required": ["rarity", "version"], + "properties": { + "rarity": { + "type": "integer", + "format": "int32", + "examples": [5], + }, + "version": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["diamond"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/version/12/" + ], + }, + }, + }, + }, + }, + }, + }, + } + ) def get_pokemon_held_items(self, obj): # Get items related to this pokemon and pull out unique Item IDs pokemon_items = PokemonItem.objects.filter(pokemon_id=obj).order_by("item_id") @@ -2847,6 +4778,39 @@ def get_pokemon_held_items(self, obj): return item_list + # { + # "ability": { + # "name": "sand-veil", + # "url": "https://pokeapi.co/api/v2/ability/8/" + # }, + # "is_hidden": false, + # "slot": 1 + # }, + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["ability", "is_hidden", "slot"], + "properties": { + "ability": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["sand-veil"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/ability/8/"], + }, + }, + }, + "is_hidden": {"type": "boolean"}, + "slot": {"type": "integer", "format": "int32", "examples": [1]}, + }, + }, + } + ) def get_pokemon_abilities(self, obj): pokemon_ability_objects = PokemonAbility.objects.filter(pokemon=obj) data = PokemonAbilitySerializer( @@ -2860,6 +4824,77 @@ def get_pokemon_abilities(self, obj): return abilities + # { + # "abilities": [ + # { + # "ability": { + # "name": "levitate", + # "url": "https://pokeapi.co/api/v2/ability/26/" + # }, + # "is_hidden": false, + # "slot": 1 + # } + # ], + # "generation": { + # "name": "generation-vi", + # "url": "https://pokeapi.co/api/v2/generation/6/" + # } + # } + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["abilities", "generation"], + "properties": { + "abilities": { + "type": "array", + "items": { + "type": "object", + "required": ["ability", "is_hidden", "slot"], + "properties": { + "ability": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["levitate"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/ability/26/" + ], + }, + }, + }, + "is_hidden": {"type": "boolean"}, + "slot": { + "type": "integer", + "format": "int32", + "examples": [1], + }, + }, + }, + }, + "generation": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["generation-vi"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/generation/6/"], + }, + }, + }, + }, + }, + } + ) def get_past_pokemon_abilities(self, obj): pokemon_past_ability_objects = PokemonAbilityPast.objects.filter(pokemon=obj) pokemon_past_abilities = PokemonAbilityPastSerializer( @@ -2895,6 +4930,37 @@ def get_past_pokemon_abilities(self, obj): return final_data + # { + # "slot": 1, + # "type": { + # "name": "ghost", + # "url": "https://pokeapi.co/api/v2/type/8/" + # } + # }, + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["slot", "type"], + "properties": { + "slot": {"type": "integer", "format": "int32", "examples": [1]}, + "type": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["ghost"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/type/8/"], + }, + }, + }, + }, + }, + } + ) def get_pokemon_types(self, obj): poke_type_objects = PokemonType.objects.filter(pokemon=obj) poke_types = PokemonTypeSerializer( @@ -2906,6 +4972,77 @@ def get_pokemon_types(self, obj): return poke_types + # "past_types": [ + # { + # "generation": { + # "name": "generation-v", + # "url": "https://pokeapi.co/api/v2/generation/5/" + # }, + # "types": [ + # { + # "slot": 1, + # "type": { + # "name": "normal", + # "url": "https://pokeapi.co/api/v2/type/1/" + # } + # } + # ] + # } + # ], + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["generation", "types"], + "properties": { + "generation": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["generation-v"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/generation/5/"], + }, + }, + }, + "types": { + "type": "array", + "items": { + "type": "object", + "required": ["slot", "type"], + "properties": { + "slot": { + "type": "integer", + "format": "int32", + "examples": [1], + }, + "type": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": ["normal"], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/type/1/" + ], + }, + }, + }, + }, + }, + }, + }, + }, + } + ) def get_past_pokemon_types(self, obj): poke_past_type_objects = PokemonTypePast.objects.filter(pokemon=obj) poke_past_types = PokemonTypePastSerializer( @@ -2941,6 +5078,12 @@ def get_past_pokemon_types(self, obj): return final_data + @extend_schema_field( + field={ + "type": "string", + "examples": ["https://pokeapi.co/api/v2/pokemon/1/encounters"], + } + ) def get_encounters(self, obj): return reverse("pokemon_encounters", kwargs={"pokemon_id": obj.pk}) @@ -2966,6 +5109,23 @@ class Meta: model = EvolutionTrigger fields = ("id", "name", "names", "pokemon_species") + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["ivysaur"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokemon-species/2/"], + }, + }, + }, + } + ) def get_species(self, obj): evo_objects = PokemonEvolution.objects.filter(evolution_trigger=obj) species_list = [] @@ -3073,6 +5233,30 @@ class Meta: "varieties", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["language", "name"], + "properties": { + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + }, + }, + "name": {"type": "string", "examples": ["bulbasaur"]}, + }, + }, + } + ) def get_pokemon_names(self, obj): species_results = PokemonSpeciesName.objects.filter(pokemon_species=obj) species_serializer = PokemonSpeciesNameSerializer( @@ -3086,6 +5270,37 @@ def get_pokemon_names(self, obj): return data + # { + # "genus": "Seed Pokémon", + # "language": { + # "name": "en", + # "url": "https://pokeapi.co/api/v2/language/9/" + # } + # }, + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["genus", "language"], + "properties": { + "genus": {"type": "string", "examples": ["Seed Pokémon"]}, + "language": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["en"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/language/9/"], + }, + }, + }, + }, + }, + } + ) def get_pokemon_genera(self, obj): results = PokemonSpeciesName.objects.filter(pokemon_species=obj) serializer = PokemonSpeciesNameSerializer( @@ -3101,6 +5316,23 @@ def get_pokemon_genera(self, obj): return genera + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["monster"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/egg-group/1/"], + }, + }, + }, + } + ) def get_pokemon_egg_groups(self, obj): results = PokemonEggGroup.objects.filter(pokemon_species=obj) data = PokemonEggGroupSerializer(results, many=True, context=self.context).data @@ -3110,6 +5342,30 @@ def get_pokemon_egg_groups(self, obj): return groups + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["is_default", "pokemon"], + "properties": { + "is_default": {"type": "boolean"}, + "pokemon": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bulbasaur"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokemon/1/"], + }, + }, + }, + }, + }, + } + ) def get_pokemon_varieties(self, obj): results = Pokemon.objects.filter(pokemon_species=obj) summary_data = PokemonSummarySerializer( @@ -3129,6 +5385,37 @@ def get_pokemon_varieties(self, obj): return varieties + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["area", "base_score", "rate"], + "properties": { + "area": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["field"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/pal-park-area/2/" + ], + }, + }, + }, + "base_score": { + "type": "integer", + "format": "int32", + "examples": [50], + }, + "rate": {"type": "integer", "format": "int32", "examples": [30]}, + }, + }, + } + ) def get_encounters(self, obj): pal_park_objects = PalPark.objects.filter(pokemon_species=obj) parks = PalParkSerializer( @@ -3186,6 +5473,214 @@ class Meta: model = EvolutionChain fields = ("id", "baby_trigger_item", "chain") + # TODO: Revisit Schema + @extend_schema_field( + field={ + "type": "object", + "required": ["evolution_details", "evolves_to", "is_baby", "species"], + "properties": { + "evolution_details": {"type": "array", "items": {}, "examples": []}, + "evolves_to": { + "type": "array", + "items": { + "type": "object", + "required": [ + "evolution_details", + "evolves_to", + "is_baby", + "species", + ], + "properties": { + "evolution_details": { + "type": "array", + "items": { + "type": "object", + "required": [ + "gender", + "held_item", + "item", + "known_move", + "known_move_type", + "location", + "min_affection", + "min_beauty", + "min_happiness", + "min_level", + "needs_overworld_rain", + "party_species", + "party_type", + "relative_physical_stats", + "time_of_day", + "trade_species", + "trigger", + "turn_upside_down", + ], + "properties": { + "gender": { + "type": "", + "nullable": True, + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": [1], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [2], + }, + }, + }, + "held_item": { + "type": "object", + "nullable": True, + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": [1], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [2], + }, + }, + }, + "item": { + "type": "object", + "nullable": True, + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + "examples": [1], + }, + "url": { + "type": "string", + "format": "uri", + "examples": [2], + }, + }, + }, + "known_move": { + "type": "", + "nullable": True, + }, + "known_move_type": { + "type": "", + "nullable": True, + }, + "location": { + "type": "object", + "nullable": True, + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + }, + "url": { + "type": "string", + "format": "uri", + }, + }, + }, + "min_affection": { + "type": "integer", + "format": "int32", + "nullable": True, + }, + "min_beauty": { + "type": "integer", + "format": "int32", + "nullable": True, + }, + "min_happiness": { + "type": "integer", + "format": "int32", + "nullable": True, + }, + "min_level": { + "type": "integer", + "format": "int32", + "nullable": True, + }, + "needs_overworld_rain": { + "type": "boolean", + "nullable": True, + }, + "party_species": { + "type": "string", + "nullable": True, + }, + "party_type": { + "type": "string", + "nullable": True, + }, + "relative_physical_stats": { + "type": "string", + "nullable": True, + }, + "time_of_day": {"type": "string"}, + "trade_species": { + "type": "string", + "nullable": True, + }, + "trigger": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": { + "type": "string", + }, + "url": { + "type": "string", + "format": "uri", + }, + }, + }, + "turn_upside_down": {"type": "boolean"}, + }, + }, + }, + "is_baby": {"type": "boolean"}, + "species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["happiny"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/440/" + ], + }, + }, + }, + }, + }, + }, + "is_baby": {"type": "boolean"}, + "species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["happiny"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/440/" + ], + }, + }, + }, + }, + } + ) def build_chain(self, obj): chain_id = obj.id @@ -3298,6 +5793,72 @@ class Meta: model = PokeathlonStat fields = ("id", "name", "affecting_natures", "names") + @extend_schema_field( + field={ + "type": "object", + "required": ["decrease", "increase"], + "properties": { + "decrease": { + "type": "array", + "items": { + "type": "object", + "required": ["max_change", "nature"], + "properties": { + "max_change": { + "type": "integer", + "format": "int32", + "maximum": -1, + "examples": [-1], + }, + "nature": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["hardy"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/nature/1/" + ], + }, + }, + }, + }, + }, + }, + "increase": { + "type": "array", + "items": { + "type": "object", + "required": ["max_change", "nature"], + "properties": { + "max_change": { + "type": "integer", + "format": "int32", + "minimum": 1, + "examples": [2], + }, + "nature": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["hardy"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/nature/1/" + ], + }, + }, + }, + }, + }, + }, + }, + } + ) def get_natures_that_affect(self, obj): stat_change_objects = NaturePokeathlonStat.objects.filter(pokeathlon_stat=obj) stat_changes = NaturePokeathlonStatSerializer( @@ -3356,6 +5917,36 @@ class Meta: "version_groups", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["entry_number", "pokemon_species"], + "properties": { + "entry_number": { + "type": "integer", + "format": "int32", + "examples": [1], + }, + "pokemon_species": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["bulbasaur"]}, + "url": { + "type": "string", + "format": "uri", + "examples": [ + "https://pokeapi.co/api/v2/pokemon-species/1/" + ], + }, + }, + }, + }, + }, + } + ) def get_pokedex_entries(self, obj): results = PokemonDexNumber.objects.filter(pokedex=obj).order_by( "pokedex_number" @@ -3370,6 +5961,23 @@ def get_pokedex_entries(self, obj): return data + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["the-teal-mask"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/version-group/26/"], + }, + }, + }, + } + ) def get_pokedex_version_groups(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(pokedex=obj) dex_groups = PokedexVersionGroupSerializer( @@ -3429,6 +6037,23 @@ class Meta: "versions", ) + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["kanto"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/region/1/"], + }, + }, + }, + } + ) def get_version_group_regions(self, obj): vg_regions = VersionGroupRegion.objects.filter(version_group=obj) data = VersionGroupRegionSerializer( @@ -3441,6 +6066,25 @@ def get_version_group_regions(self, obj): return regions + # "name": "level-up", + # "url": "https://pokeapi.co/api/v2/move-learn-method/1/" + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["level-up"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/move-learn-method/1/"], + }, + }, + }, + } + ) def get_learn_methods(self, obj): learn_method_objects = VersionGroupMoveLearnMethod.objects.filter( version_group=obj @@ -3455,6 +6099,23 @@ def get_learn_methods(self, obj): return methods + @extend_schema_field( + field={ + "type": "array", + "items": { + "type": "object", + "required": ["name", "url"], + "properties": { + "name": {"type": "string", "examples": ["kanto"]}, + "url": { + "type": "string", + "format": "uri", + "examples": ["https://pokeapi.co/api/v2/pokedex/2/"], + }, + }, + }, + } + ) def get_version_groups_pokedexes(self, obj): dex_group_objects = PokedexVersionGroup.objects.filter(version_group=obj) dex_groups = PokedexVersionGroupSerializer( diff --git a/pokemon_v2/tests.py b/pokemon_v2/tests.py index e458f467c..efa42567d 100644 --- a/pokemon_v2/tests.py +++ b/pokemon_v2/tests.py @@ -1679,42 +1679,46 @@ def setup_pokemon_sprites_data( showdown = { "front_default": showdown_path % pokemon.id if front_default else None, - "front_female": showdown_path % f"female/{pokemon.id}" - if front_female - else None, - "front_shiny": showdown_path % f"shiny/{pokemon.id}" - if front_shiny - else None, - "front_shiny_female": showdown_path % f"shiny/female/{pokemon.id}" - if front_shiny_female - else None, - "back_default": showdown_path % f"back/{pokemon.id}" - if back_default - else None, - "back_female": showdown_path % f"back/female/{pokemon.id}" - if back_female - else None, - "back_shiny": showdown_path % f"back/shiny/{pokemon.id}" - if back_shiny - else None, - "back_shiny_female": showdown_path % f"back/shiny/female/{pokemon.id}" - if back_shiny_female - else None, + "front_female": ( + showdown_path % f"female/{pokemon.id}" if front_female else None + ), + "front_shiny": ( + showdown_path % f"shiny/{pokemon.id}" if front_shiny else None + ), + "front_shiny_female": ( + showdown_path % f"shiny/female/{pokemon.id}" + if front_shiny_female + else None + ), + "back_default": ( + showdown_path % f"back/{pokemon.id}" if back_default else None + ), + "back_female": ( + showdown_path % f"back/female/{pokemon.id}" if back_female else None + ), + "back_shiny": ( + showdown_path % f"back/shiny/{pokemon.id}" if back_shiny else None + ), + "back_shiny_female": ( + showdown_path % f"back/shiny/female/{pokemon.id}" + if back_shiny_female + else None + ), } sprites = { "front_default": sprite_path % pokemon.id if front_default else None, "front_female": sprite_path % pokemon.id if front_female else None, "front_shiny": sprite_path % pokemon.id if front_shiny else None, - "front_shiny_female": sprite_path % pokemon.id - if front_shiny_female - else None, + "front_shiny_female": ( + sprite_path % pokemon.id if front_shiny_female else None + ), "back_default": sprite_path % pokemon.id if back_default else None, "back_female": sprite_path % pokemon.id if back_female else None, "back_shiny": sprite_path % pokemon.id if back_shiny else None, - "back_shiny_female": sprite_path % pokemon.id - if back_shiny_female - else None, + "back_shiny_female": ( + sprite_path % pokemon.id if back_shiny_female else None + ), } pokemon_sprites = PokemonSprites.objects.create( @@ -5099,6 +5103,25 @@ def test_pokemon_api(self): "{}".format(cries_data["legacy"]), ) + # test search pokemon using search query param `q=partial_name` + + response = self.client.get( + "{}/pokemon/?q={}".format(API_V2, pokemon.name[:2]), + HTTP_HOST="testserver", + ) + + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data["count"], 1) + self.assertEqual(response.data["results"][0]["name"], pokemon.name) + + response = self.client.get( + "{}/pokemon/?q={}".format(API_V2, pokemon.name[-3:]), + ) + + self.assertEqual(response.status_code, status.HTTP_200_OK) + self.assertEqual(response.data["count"], 1) + self.assertEqual(response.data["results"][0]["name"], pokemon.name) + def test_pokemon_form_api(self): pokemon_species = self.setup_pokemon_species_data() pokemon = self.setup_pokemon_data(pokemon_species=pokemon_species) diff --git a/requirements.txt b/requirements.txt index c7d6d4a69..383b8bbd5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,3 +11,4 @@ mimeparse==0.1.3 psycopg2-binary==2.9.9 python-dateutil==2.8.2 python-mimeparse==1.6.0 +drf-spectacular==0.27.2