{"id":17914043,"url":"https://github.com/monbrey/pokeapi-typescript","last_synced_at":"2025-10-05T07:04:38.369Z","repository":{"id":35053632,"uuid":"201133439","full_name":"monbrey/pokeapi-typescript","owner":"monbrey","description":"Typescript SDK for PokeAPI (https://pokeapi.co)","archived":false,"fork":false,"pushed_at":"2025-03-11T10:08:41.000Z","size":312,"stargazers_count":23,"open_issues_count":0,"forks_count":6,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-19T00:17:55.845Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/monbrey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-08-07T21:55:28.000Z","updated_at":"2025-03-17T23:03:43.000Z","dependencies_parsed_at":"2024-06-19T05:23:02.975Z","dependency_job_id":"c999fa61-7e6a-4384-b6c4-d46deb870b81","html_url":"https://github.com/monbrey/pokeapi-typescript","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monbrey%2Fpokeapi-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monbrey%2Fpokeapi-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monbrey%2Fpokeapi-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/monbrey%2Fpokeapi-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/monbrey","download_url":"https://codeload.github.com/monbrey/pokeapi-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245186433,"owners_count":20574550,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-28T19:55:33.816Z","updated_at":"2025-10-05T07:04:33.321Z","avatar_url":"https://github.com/monbrey.png","language":"TypeScript","readme":"# pokeapi-typescript\n\n## About\n\npokeapi-typescript is a fully-typed SDK for the [PokeAPI](https://pokeapi.co) using Promises, featuring an easy to manage cache which utilises [Collections](https://github.com/discordjs/collection)\n\n## Installation\n\nvia yarn: `yarn add pokeapi-typescript`\n\nvia npm: `npm install pokeapi-typescript`\n\n## Getting Started\n\nTo start using the PokeAPI, import the module. All available endpoints are mounted as static properties of the module.\n```js\n// ES6 imports\nimport { PokeAPI } from \"pokeapi-typescript\";\n```\n\n### Endpoints\n\nEvery endpoint documented in the [PokeAPI Docs](https://pokeapi.co/docs/v2.html) is available. By default, any data that is fetched will be cached in-memory.\n\n### .resolve()\n\n`PokeAPI.\u003cEndpoint\u003e.resolve()` retrieves a resource, first checking the internal cache to see if it is available. If no cached resource exists, it will be fetched via the API.\n\n#### By ID\n```js\n// Using .then()\nPokeAPI.Pokemon.resolve(25).then(result =\u003e console.log(result));\n\n// Using async/await\nconst result = await PokeAPI.Pokemon.resolve(25);\n```\n\n#### By Name\n```js\n// Using.then()\nPokeAPI.Pokemon.resolve(\"pikachu\").then(result =\u003e console.log(result));\n\n// Using async/await\nconst result = await PokeAPI.Pokemon.resolve(\"pikachu\");\n```\n\n### .fetch()\n\n`PokeAPI.\u003cEndpoint\u003e.fetch()` will always retrieve a resource via the API, updating any cached resources in the process.\n\n#### By ID\n```js\n// Using .then()\nPokeAPI.Pokemon.fetch(25).then(result =\u003e console.log(result));\n\n// Using async/await\nconst result = await PokeAPI.Pokemon.fetch(25);\n```\n\n#### By Name\n```js\n// Using.then()\nPokeAPI.Pokemon.fetch(\"pikachu\").then(result =\u003e console.log(result));\n\n// Using async/await\nconst result = await PokeAPI.Pokemon.fetch(\"pikachu\");\n```\n\n### .get()\n\n`PokeAPI.\u003cEndpoint\u003e.get()` will always retrieve a cached resource, returning null if one could not be found. `.get()` is synchronous and does not return a Promise.\n\n#### By ID\n```js\nconst result = PokeAPI.Pokemon.get(25);\n```\n\n#### By Name\n```js\nconst result = PokeAPI.Pokemon.get(\"pikachu\");\n```\n\n### .list()\n\n`PokeAPI.\u003cEndpoint\u003e.list()` retrieves the [IApiResourceList](https://pokeapi.co/docs/v2.html#un-named) or [INamedApiResourceList](https://pokeapi.co/docs/v2.html#named) for an endpoint.\n\n`list()` accepts two parameters for pagination\n - `limit` - Number of results to list. Default 20\n - `offset` - Index of result to start listing from. Default 0\n\n```js\n// Fetch 1000 Pokemon (all) in a NamedApiResourceList\nconst resourceList = await PokeAPI.Pokemon.list(1000, 0);\n```\n`resourceList.results` will contain an array of `IApiResource` or `INamedApiResource` objects depending on the type of list.\n\n### .listAll()\n\n`PokeAPI.\u003cEndpoint\u003e.listAll()` functions like the above, but will return the complete list for an endpoint. This is done by making two API calls.\n```js\n// Fetch 1000 Pokemon (all) in a NamedApiResourceList\nconst completeResourceList = await PokeAPI.Pokemon.listAll();\n```\n\n## Endpoint List\n\n#### Berries\n\n - Berry\n - BerryFirmness\n - BerryFlavors\n\n#### Contests\n\n - ContestType\n - ContestEffect\n - SuperContestEffect\n\n#### Encounters\n\n - EncounterMethod\n - EncounterCondition\n - EncounterConditionValue\n\n#### Evolution\n\n - EvolutionChain\n - EvolutionTrigger\n\n#### Games\n\n - Generation\n - Pokedex\n - Version\n - VersionGroup\n\n#### Items\n\n - Item\n - ItemAttribute\n - ItemCategory\n - ItemFlingEffect\n - ItemPocket\n\n##### Locations\n\n - Location\n - LocationArea\n - PalParkArea\n - Region\n\n#### Machines\n\n - Machine\n\n#### Moves\n\n - Move\n - MoveAilment\n - MoveBattleStyle\n - MoveCategory\n - MoveDamageClass\n - MoveLearnMethod\n - MoveTarget\n\n#### Pokemon\n\n - Ability\n - Characteristic\n - EggGroup\n - Gender\n - GrowthRate\n - Nature\n - PokeathlonStat\n - Pokemon\n - PokemonColor\n - PokemonForm\n - PokemonHabitat\n - PokemonShape\n - PokemonSpecies\n - Stat\n - Type\n\n#### Utility\n\n - Language","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonbrey%2Fpokeapi-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmonbrey%2Fpokeapi-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmonbrey%2Fpokeapi-typescript/lists"}