From fb49f92735f5e8fe566fa3db7ba05cc32bd861e0 Mon Sep 17 00:00:00 2001 From: Maxopoly Date: Thu, 4 Nov 2021 17:12:57 +0100 Subject: [PATCH] Create README.md --- README.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9729f7e --- /dev/null +++ b/README.md @@ -0,0 +1,31 @@ +# Tcgdex-java + +This is a Java API for querying the Pokémon TCG database of [TCGdex](https://github.com/tcgdex/). + +To use it, first initialize an API instance with the language you want results to be in +```java +TCGDexAPI api = new TCGDexAPI(TCGDexAPI.Language.EN); +``` + +Use it to obtain POJOs representing cards, sets and series. For all of these, there is a function listing all available including short info and a function to get detailed information regarding one. + +```java +//all cards available +List allCards = api.getAllCards(); +//detailed card info +CardInfo card = api.getCardInfo(allCards.get(23)); + +//all sets available +List allSets = getAllSets(); +//Obtained set info either based on the listing of all sets +SetInfo set = getSetInfo(allSets.get(1)); +//or based on some card, also works for CardInfo +SetInfo set2 = getSetInfo(allCards.get(10)); + +//all series available +List allSeries = getAllSeries(); +//same possibilties for series +SeriesInfo series = getSeriesInfo(allSeries.get(2)); +SeriesInfo series2 = getSeriesInfo(set); + +```