{"id":15893418,"url":"https://github.com/multimeric/pokemontcgscraper","last_synced_at":"2025-03-20T12:34:25.889Z","repository":{"id":31599174,"uuid":"35164037","full_name":"multimeric/pokemontcgscraper","owner":"multimeric","description":"Scrapes the official Pokemon website for pokemon card data","archived":false,"fork":false,"pushed_at":"2020-10-02T05:27:45.000Z","size":161,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-26T20:07:22.872Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multimeric.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-05-06T14:38:00.000Z","updated_at":"2024-01-19T15:26:29.000Z","dependencies_parsed_at":"2022-09-10T00:51:49.632Z","dependency_job_id":null,"html_url":"https://github.com/multimeric/pokemontcgscraper","commit_stats":null,"previous_names":["tmiguelt/pokemontcgscraper"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fpokemontcgscraper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fpokemontcgscraper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fpokemontcgscraper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multimeric%2Fpokemontcgscraper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multimeric","download_url":"https://codeload.github.com/multimeric/pokemontcgscraper/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221766860,"owners_count":16877362,"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-06T08:10:28.936Z","updated_at":"2024-10-28T02:22:18.991Z","avatar_url":"https://github.com/multimeric.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pokemon TCG Scraper\n\n[![Build Status](https://travis-ci.org/TMiguelT/pokemontcgscraper.svg?branch=master)](https://travis-ci.org/TMiguelT/pokemontcgscraper)\n\n## Introduction\n\nThe pokemon TCG scraper does what you'd expect - it scrapes the official pokemon.com TCG database. The resulting data\ncan be used to populate databases, make calculations, or any other purpose.\n\n## Usage\n\nFirst, to install the module, simply run `npm install pokemon-tcg-scraper`, and in your code add\n`var scraper = require('pokemon-tcg-scraper')`\n\nYou can then run queries using the promise interface (note: there is no callback interface, but you can treat the then()\nargument as the callback). For example, if we wanted data on the Blastoise from Boundaries Crossed, we'd find the URL\nand run:\n\n```javascript\nscraper.scrapeCard(\"http://www.pokemon.com/us/pokemon-tcg/pokemon-cards/bw-series/bw7/31/\").then(function(card){\n    console.log(JSON.stringify(card, null, 4));\n});\n```\n\nThis will print the following:\n\n```json\n{\n    \"id\": \"bw7/31\",\n    \"name\": \"Blastoise\",\n    \"image\": \"http://assets21.pokemon.com/assets/cms2/img/cards/web/BW7/BW7_EN_31.png\",\n    \"type\": \"Stage 2 Pokémon\",\n    \"superType\": \"Pokémon\",\n    \"evolvesFrom\": \"Wartortle\",\n    \"hp\": 140,\n    \"passive\": {\n        \"name\": \"Deluge\",\n        \"text\": \"As often as you like during your turn (before your attack), you may attach a Water Energy card from your hand to 1 of your Pokémon.\"\n    },\n    \"abilities\": [\n        {\n            \"cost\": [\n                \"Colorless\",\n                \"Colorless\",\n                \"Colorless\",\n                \"Colorless\"\n            ],\n            \"name\": \"Hydro Pump\",\n            \"damage\": \"60+\",\n            \"text\": \"Does 10 more damage for each Water Energy attached to this Pokémon.\"\n        }\n    ],\n    \"rules\": [],\n    \"color\": \"Water\",\n    \"weaknesses\": [\n        {\n            \"type\": \"Grass\",\n            \"value\": \"×2\"\n        }\n    ],\n    \"resistances\": [],\n    \"retreatCost\": 4\n}\n```\n\n## API\n\nThe TCG scraper exposes 3 functions:\n\n* scrapeAll(query, scrapeDetails)\n* scrapeCard(url)\n* scrapeSearchPage(url)\n\n`scrapeAll` Queries the official Pokemon database using the first parameter, which is an object consisting of key/value\npairs to be used in the query string. The specification of this is described in the node querystring module. The function\nreturns an array of cards, each with a `url` and `image` property. If scrapeDetails is true, which it is by default, then\nthe scraper will also run scrapeCard on each card, and augment it with all the fields listed in the output section.\n\n`scrapeCard(url)` Takes a card URL (i.e. a URL in the pokemon TCG website, like \"http://www.pokemon.com/us/pokemon-tcg/pokemon-cards/bw-series/bw7/31/\") and returns all data from the page. This is\nused internally but it can also be useful for scraping specific cards.\n\n`scrapeSearchPage(url)` Also used internally, but this time it scrapes one of the pages of the search results (e.g.\n\"http://www.pokemon.com/us/pokemon-tcg/pokemon-cards/2?card-darkness=\"). Returns an array of cards with the `url` and\n`image` properties described above.\n\n## Output\n\n### Pokemon\n\nIf the scraper encounters a pokemon card, it outputs objects with the following fields\n\n * `id`: The unique identifier used by pokemon.com for this card based on the card's set, e.g. \"bw7/31\",\n * `image`: The image URL for the card on pokemon.com, e.g. \"http://assets21.pokemon.com/assets/cms2/img/cards/web/BW7/BW7_EN_31.png\",\n * `name`: The pokemon's name, e.g. \"Blastoise\",\n * `type`: The specific of card, e.g. \"Stage 2 Pokémon\",\n * `superType`: The general type of card, e.g. \"Pokémon\",\n * `evolvesFrom`: The previous evolution, e.g. \"Wartortle\",\n * `hp`: The card's hit points, e.g. 140,\n * `color`: The card's colour, e.g. \"Water\",\n * `passive`:  The card's passive ability (Ability, Pokemon Power, Poke Body etc.) Contains a `name` and `text` field.\n e.g.\n```json\n{\n    \"name\": \"Deluge\",\n    \"text\": \"As often as you like during your turn (before your attack), you may attach a Water Energy card from your hand to 1 of your Pokémon.\"\n},\n```\n * `abilities` An array of abilities, consisting of `cost`, `name`, `damage`, and `text`. E.g.\n```json\n[\n    {\n        \"cost\": [\n            \"Colorless\",\n            \"Colorless\",\n            \"Colorless\",\n            \"Colorless\"\n        ],\n        \"name\": \"Hydro Pump\",\n        \"damage\": \"60+\",\n        \"text\": \"Does 10 more damage for each Water Energy attached to this Pokémon.\"\n    }\n]\n```\n * `weaknesses` An object with `type` and `value` fields indicating the Pokemon's weakness. E.g.\n ```json\n [\n        {\n            \"type\": \"Grass\",\n            \"value\": \"×2\"\n        }\n]\n```\n * `resistances` An array containing a list of weaknesses with the `type` and `value` fields. E.g.\n   ```json\n    [\n       {\n           \"type\": \"Psychic\",\n           \"value\": \"-20\"\n       }\n   ]\n   ```\n * `retreatCost` The cost (as an integer, the number of colourless energies) to retreat the Pokemon. E.g. 2\n\n### Other\n\nAll other cards (energies and trainers) simply have the fields `name` and `text`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fpokemontcgscraper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultimeric%2Fpokemontcgscraper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultimeric%2Fpokemontcgscraper/lists"}