Welcome

This API gives you access to card data from GWENT: The Witcher Card Game. More features are slowly getting rolled out so be sure to check back once in a while.

Request

You can use GET or POST on api.gwent.one.
On the POST request you can use Content-Type: application/x-www-form-urlencoded or JSON Content-Type: application/json

GET Examples

https://api.gwent.one/?key=data&version=1.0.0.15
https://api.gwent.one/?key=data&response=csv&version=3.0.0
https://api.gwent.one/?key=data&id=201727&response=html&html=version.artsize.linkart&class=rounded&version=1.1.0

POST Example

POST / HTTP/1.1
Host: api.gwent.one
Content-Type: application/x-www-form-urlencoded
Content-Length: 25
key=data&version=1.0.0.15

Response Types

response=json/csv/html

There are 3 ways to get your data: JSON (default), CSV, HTML.
They all behave differently and only json gives you a full data set of everything that is available in the DB.

json

Returns all the data. if you want voice lines filenames add 'audio=1' to your request

csv

For your spreadsheets

html

Use these to toggle what is enabled in the html response. Example:
https://api.gwent.one?key=data&id=112106&response=html&html=href.version.keywords

html
info.art.keywords.flavor.version.href
  • option
  • default
  • description
  • info
  • enabled
  • removes all of the text
  • art
  • enabled
  • removes the card art
  • keywords
  • enabled
  • disable the keywords
  • flavor
  • enabled
  • disable the flavor text
  • version
  • disabled
  • show the game version '8.4.0', use css content: "Gwent v" for styling
  • linkname
  • disabled
  • name = link to the card on gwent.one
  • linkart
  • disabled
  • art = link to the card on gwent.one
  • dataatr
  • disabled
  • minimal/full data-attributes on .G1-card (full => easier js manipulation)
HTML Response Example

Download: HTML API package - includes JS, CSS, SCSS, readme.

This API now features a HTML response. This allows you to include cards from gwent.one and add them to articles easily. There are multiple ways to do this and if you want more information download the package which includes documentation as well as the requirements and styles to help you implement things. If you have further questions just message me on discord/email.


<div class="G1-load" data-g1id="200165" data-g1html="version.linkname.artist" data-g1version="1.0.0.15"></div>
<div class="G1-load" data-g1id="200165" data-g1html="version.artsize.flavor" data-g1class="rounded" data-g1version="7.2.0"></div>
			

Auto loading with Javascript.

window.addEventListener( 'load', () => {
api = new G1api();
api.listen('.G1-load');
} );

Above examples wrapped in a simple css grid. These were requested by the API, if you check your dev console.

Using Tippy.js to create tooltips in text. For more information check the package.

Here are some random cards Yennefer: Conjurer in a text paragraph. CDPR can you please buff Collar and Force of Nature they don't see play because of the insane combo of Draug, Dryad Fledgling, Heymaey Skald and Passiflora. Also one of the least played cards is Novigradian Justice. I don't know why you keep nerfing the cards I play.

Data Access

key=data

To access the data you need to provide a key. Use the the key 'data'.
If you access the full card list please cache your results. The full card list for a single language is about 1MB and for all the languages this increases to 14MB++
There are currently not limits and I don't really want to change that. If I notice abusive behaviour that might change.
If you have used the previous API you can use your old key. And if you want a key in case I have to remove 'data' just write me a message.

Defaults
Full card list
language
en
version
latest
response
json
Options
language
all, cn, de, en, es, fr, it, jp, kr, mx, pl, pt, ru
version
8.4.0, 8.3.0, ..., 1.0.0.15
deckbuilder
mo, ng, nr, st, sk, sy - sorted deckbuilder cards
id
201727
Changelog

Changelog

2021-04-29 new: response csv/html, documentation rewrite
2021-03-29 enabled api.gwent.one

Resources
Localization
https://github.com/teddybee-r/GwentLocalization
Postgres DB
https://github.com/teddybee-r/GwentOneDB
Version list
https://gwent.one/en/cards/changelog/