Introduction
Microsserviço de rankings e métricas de jogos para integração com o ecossistema GameVerse.
Esta API expõe rankings semanais, mensais e anuais, jogos mais jogados e histórico de pontuação.
<aside>Use os exemplos da documentação para demonstrar como o frontend ou outros microsserviços podem consumir os dados de ranking.</aside>
Authenticating requests
To authenticate requests, include an Authorization header with the value "Bearer {YOUR_JWT_TOKEN}".
All authenticated endpoints are marked with a requires authentication badge in the documentation below.
Use um token JWT RS256 emitido pelo serviço de autenticação integrado ao GameVerse.
Rankings
Top semanal
requires authentication
Retorna o ranking dos jogos com melhor desempenho na última semana.
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/rankings/weekly" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://127.0.0.1:8000/api/v1/rankings/weekly"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 54
access-control-allow-origin: *
{
"message": "Invalid or expired token"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Top mensal
requires authentication
Retorna o ranking dos jogos com melhor desempenho no último mês.
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/rankings/monthly" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://127.0.0.1:8000/api/v1/rankings/monthly"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 53
access-control-allow-origin: *
{
"message": "Invalid or expired token"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Top anual
requires authentication
Retorna o ranking dos jogos com melhor desempenho no último ano.
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/rankings/yearly" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://127.0.0.1:8000/api/v1/rankings/yearly"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 52
access-control-allow-origin: *
{
"message": "Invalid or expired token"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Histórico de ranking
requires authentication
Retorna a evolução de um jogo específico ao longo do tempo.
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/rankings/history/1" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://127.0.0.1:8000/api/v1/rankings/history/1"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 51
access-control-allow-origin: *
{
"message": "Invalid or expired token"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Jogos mais jogados
requires authentication
Retorna o top 10 jogos com base no número de jogadores ativos.
Example request:
curl --request GET \
--get "http://127.0.0.1:8000/api/v1/games/most-played" \
--header "Authorization: Bearer {YOUR_JWT_TOKEN}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"const url = new URL(
"http://127.0.0.1:8000/api/v1/games/most-played"
);
const headers = {
"Authorization": "Bearer {YOUR_JWT_TOKEN}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());Example response (401):
Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 60
x-ratelimit-remaining: 50
access-control-allow-origin: *
{
"message": "Invalid or expired token"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.