API Rest to consult informations about tibia characters
Unfortunally, Cipsoft doens't provide an API to get any information about Tibia Chararacters. So, I've created this API which receives a character name and scrapps tibia website bringing general informations about the character.
The first version was wrote using a simple POST. But now, I refactored to use GraphQL. You can use the panel to check it out the informations and make queries or you can consume it by a HTTP POST. Following the explanation to use both methods.
To consult a player informations using this panel, you must write a query passing the character name and which informations you'd like to receive, for example:
query{
character(characterName: "mad dentist") {
name
sex
vocation
level
achievmentPoint
world
residence
lastLogin
accountStatus
}
}
And you'll receive a JSON like this:
To consume this API using HTTP POST, you must send a header requiring an 'application/json' and send a JSON with one key (query) and the same query made on GraphQL panel.
{
"query": "{ character(characterName: \"mad dentist\") {name sex vocation level achievmentPoint world residence lastLogin } }"
}
How we can see, it's the same query, but just in one line.
{
"data": {
"character": {
"name": "String",
"sex": "String",
"vocation": "String",
"level": "String",
"achievmentPoint": "String",
"world": "String",
"residence": "String",
"lastLogin": "String"
}
}
}
Want to contribute? Follow these recommendations.