Pokedex Data Extraction Web Service
The Pokedex Data Extraction Web Service allows computer applications to access Pokemon data from the Internet. Data is available in the well-known XML text format.
This version of the Web Service is not yet complete, since I want people to try it for themselves. Please contact me with your comments.
Query Strings
The text after the "?" in a URL is called a "query string". A query string consists of a number of name-value pairs separated by ampersands ("&"). Here is an example of a query string in a URL.
http://www.upokecenter.com/dexws/?version=diamond&number=400
In this example, the query string is highlighted. This query string has two parameters: "version" and "number." The values for each are "diamond" and "400", respectively. The above example also shows how to access the Pokedex Data Extraction Web Service.
Sample
Query String Parameters
- version
Required. The version of Pokemon for this query. This will affect many things such as number checks, etc. Possible values are red, blue, yellow, gold, silver, crystal, ruby, sapphire, firered, leafgreen, emerald, diamond, and pearl.
- number
The number of the Pokemon to query, in the national order. The range of values possible depends on the version parameter. For example, if "number=9", the Pokemon is Blastoise.
- name
The name of the Pokemon. If both the number and name are specified, the name takes precedence. This parameter accepts Japanese, English, German, and French names.
- lang
The language of the data returned. Possible values are EN, DE, FR, ES, IT, and JA. If not specified, the default is EN (English).
- data
Optional. The type of data to query. Depending on whether number and/or name are set, you can extract values for one Pokemon or all Pokemon. Possible values are shown below.
Value Description pokedata The name of the Pokemon. pokedex The Pokedex entry in the given version and language. johto The Pokemon's number in the Johto Pokedex. hoenn The Pokemon's number in the Hoenn Pokedex. sinnoh The Pokemon's number in the Sinnoh Pokedex. happiness The starting happiness for the Pokemon. stepstohatch Number of steps required for the Pokemon's egg to hatch. attackslearned A comma-separated array consisting of pairs of numbers. The first number of each pair has the level which the Pokemon can learn the move, and the second number contains the ID of the move. eggmoves A comma-separated array consisting of egg move IDs. This value appears only if the Pokemon is in its lowest stage of evolution for the given version.
Output
The output is in XML (Extensible Markup Language). The tags are in the XML namespace "http://www.upokecenter.com/dexws/". (Defining a namespace allows people to have their own vocabulary of XML tags without worrying that other people will use the same names for them.)
In the normal case, the top level element (also called tag) is "pokedex".
Depending on which parameters you set, the Web service will return different information formats:
| Parameters | Data |
|---|---|
| version + number | A machine-readable Pokedex entry on the Pokemon. The subtags within the Pokedex are generally self-explanatory. |
| version + data | A list of data items for all Pokemon. Depending on the type of data requested, the subtags will be named "name" or "value". |
| version + data + number | A list of data items for the given Pokemon. Depending on the type of data requested, the subtags will be named "name" or "value". |
If there is a problem with retrieving data, a fault will be returned and the top-level element will be "pokedexfault" instead of "pokedex". Inside this element there will be a "faultcode" and a "faultmsg" which are the numerical code and the display text respectively.