Skip to content

TibiaData API written in Golang and deployed in container (version v3 and above).

License

Notifications You must be signed in to change notification settings

TibiaData/tibiadata-api-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TibiaData API in Golang

GitHub CI Codecov GitHub go.mod version GitHub release Docker image size (tag) GitHub license

TibiaData API written in Golang and deployed in container (version v3 and above).

Documentation of API endpoints can be found on docs.tibiadata.com.

Table of Contents

API versions

Here is a summary of the TibiaData API versions

v4 is released (since 1st December 2024 )
v3 is deprecated (since 31rd January 2024)
v2 is deprecated (since 30rd April 2022)
v1 is deprecated (since 30rd April 2018)

How to use

You can either use it in a Docker container or go download the code and deploy it yourself on any server.

Keep in mind that there are restrictions on tibia.com that might impact the usage of the application being hosted yourself.

Helm

We have a Helm chart available for you to use to deploy your application to Kubernetes.

All our charts are available through charts.tibiadata.com.

Add the repository

helm repo add tibiadata https://charts.tibiadata.com
helm repo update

Search for the chart

helm repo search tibiadata

The charts-repository is located in tibiadata-helm-charts.

Docker

Our images are available on both GitHub Container Registry and Docker Hub.

This is how to pull and run the latest release of TibiaData from GHCR:

docker pull ghcr.io/tibiadata/tibiadata-api-go:latest
docker run -p 127.0.0.1:80:8080/tcp --rm -it ghcr.io/tibiadata/tibiadata-api-go:latest

You can also use Docker Hub to pull your images from.

If you want to run the latest code you can switch from latest to edge.

Docker-compose

This is a simple example on how you can get up and running with TibiaData in docker-compose, which will be running on port 8080 and be exposed locally.

version: "3"

services:
  tibiadata:
    image: ghcr.io/tibiadata/tibiadata-api-go:latest
    restart: always
    environment:
      - TIBIADATA_HOST=tibiadata.example.com
    ports:
      - 8080:8080

Local development

Build the code on your computer

docker build -t tibiadata .

Run your build locally

docker run -p 127.0.0.1:80:8080/tcp --rm -it tibiadata

Environment variables

Information will be added at a later stage.

Deployment note

You should consider to add a layer in front of this application, so you can do caching of endpoints, access controll or what ever your needs are.

We do so at least by using Kong API Gateway, which solves features like caching, rate-limiting, authentication and more.

API documentation

The hosted API documentation for our api.tibiadata.com service can be viewd at docs.tibiadata.com.

There is a swagger-generated documentation available for download on the GitHub Release of the version you are looking for.

Available endpoints

Those are the current existing endpoints.

  • GET /
  • GET /ping
  • GET /healthz
  • GET /readyz
  • GET /v4/boostablebosses
  • GET /v4/character/:name
  • GET /v4/creature/:race
  • GET /v4/creatures
  • GET /v4/fansites
  • GET /v4/guild/:name
  • GET /v4/guilds/:world
  • GET /v4/highscores/:world/:category/:vocation/:page
  • GET /v4/house/:world/:house_id
  • GET /v4/houses/:world/:town
  • GET /v4/killstatistics/:world
  • GET /v4/news/archive
  • GET /v4/news/archive/:days
  • GET /v4/news/id/:news_id
  • GET /v4/news/latest
  • GET /v4/news/newsticker
  • GET /v4/spell/:spell_id
  • GET /v4/spells
  • GET /v4/world/:name
  • GET /v4/worlds
  • GET /versions

Deprecated Endpoints

In addition to the deprecated API versions like v1, v2 and v3, there are also some endpoints that are deprecated. As of now, those are:

  • GET /health

Restricted endpoints

There are some endpoints that can be deviant between the container documentation and the hosted version. This is due to restricted mode that restrict certain API actions due to high load on the tibia.com servers.

  • /v4/highscores-filtering on vocation is removed, only the all category is valid.

General information

Tibia is a registered trademark of CipSoft GmbH. Tibia and all products related to Tibia are copyright by CipSoft GmbH.

Credits