Skip to content

Zulut30/deckview-telegram-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Blizzcore Deckview API

Public HTTP API for Hearthstone deck rendering, archetype recognition, and deck-name translation.

Base URL:

https://api.blizzcore.ru

Legacy server URL:

http://135.125.171.168/deckview-api/v1

The public API is designed to work without an API key. You can call the endpoints directly from a backend, browser, WordPress plugin, static site, or Telegram bot.

Authentication

No authentication is required for public endpoints:

  • GET /
  • GET /health
  • GET|POST /render
  • GET|POST /translate
  • GET|POST /archetype
  • GET /archetypes
  • GET|POST /v1/render
  • GET|POST /v1/translate
  • GET|POST /v1/archetype
  • GET /v1/archetypes

/publish is not public because it can publish posts to WordPress and Telegram. It remains protected on the server and is intentionally not part of the public API contract.

CORS

The API sends permissive CORS headers for public endpoints:

Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, POST, OPTIONS
Access-Control-Allow-Headers: Authorization, Content-Type, X-API-Key

Rate Limit

Public API traffic is rate-limited at the nginx layer:

30 requests per minute per IP, burst 20

If you plan to send large batches, add client-side retries with backoff.

Endpoint Summary

Method Endpoint Description
GET / API index with available endpoints
GET /health Service status
GET, POST /render Render a deck image and return metadata + image URL
GET, POST /translate Translate deck/archetype names through the local EN -> RU table
GET, POST /archetype Recognize a deck archetype from a deck code using HSGuru
GET /archetypes List known archetype translations
GET, POST /v1/* Versioned aliases for the same public endpoints

API Index

curl https://api.blizzcore.ru/

Example response:

{
  "success": true,
  "service": "deckview-api",
  "version": "v1",
  "endpoints": {
    "health": "/health",
    "render": "/render",
    "translate": "/translate",
    "archetype": "/archetype",
    "archetypes": "/archetypes",
    "v1": "/v1"
  }
}

Health

curl https://api.blizzcore.ru/health

Example response:

{
  "success": true,
  "service": "deckview",
  "status": "ok",
  "public_api": true,
  "auth_required": false,
  "publish_auth_required": true,
  "endpoints": {
    "render": "/deckview-api/v1/render",
    "translate": "/deckview-api/v1/translate",
    "archetype": "/deckview-api/v1/archetype",
    "archetypes": "/deckview-api/v1/archetypes",
    "publish": "/deckview-api/v1/publish"
  }
}

Render Deck

Generates a deck image from a Hearthstone deck code.

POST /render
Content-Type: application/json

Request body:

{
  "deck_code": "AAEC...",
  "deck_name": "Optional deck title"
}

deck_name is optional. If omitted, the image is generated without a custom title.

Render With cURL

curl -X POST "https://api.blizzcore.ru/render" \
  -H "Content-Type: application/json" \
  --data '{
    "deck_code": "AAECAR8G054GmacHmqcHm6cHxbEHy7YHDKmfBKqfBK+SB4WVB86bB+6fB5CnB5inB9SvB7TAB7nAB7vABwAA",
    "deck_name": "No Hand Hunter"
  }'

Render With GET

curl "https://api.blizzcore.ru/render?deck_code=AAEC...&deck_name=No%20Hand%20Hunter"

Accepted query aliases:

  • deck_code
  • deck
  • deck_name
  • name

Render Response

{
  "success": true,
  "cached": false,
  "deck_code": "AAEC...",
  "deck_name": "No Hand Hunter",
  "cost": 3640,
  "deck_class": "ΠžΡ…ΠΎΡ‚Π½ΠΈΠΊ",
  "deck_mode": "Π‘Ρ‚Π°Π½Π΄Π°Ρ€Ρ‚",
  "filename": "deck_20260526_214630_574807.jpg",
  "image_path": "/static/generated/deck_20260526_214630_574807.jpg",
  "image_url": "https://api.blizzcore.ru/static/generated/deck_20260526_214630_574807.jpg"
}

Use image_url directly in an <img> tag or download it from your backend.

Render From JavaScript

const response = await fetch("https://api.blizzcore.ru/render", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    deck_code: "AAECAR8G054GmacHmqcHm6cHxbEHy7YHDKmfBKqfBK+SB4WVB86bB+6fB5CnB5inB9SvB7TAB7nAB7vABwAA",
    deck_name: "No Hand Hunter"
  })
});

const deck = await response.json();
console.log(deck.image_url);

Render From Python

import requests

payload = {
    "deck_code": "AAECAR8G054GmacHmqcHm6cHxbEHy7YHDKmfBKqfBK+SB4WVB86bB+6fB5CnB5inB9SvB7TAB7nAB7vABwAA",
    "deck_name": "No Hand Hunter",
}

response = requests.post("https://api.blizzcore.ru/render", json=payload, timeout=180)
response.raise_for_status()
print(response.json()["image_url"])

Translate Deck Name

Translates one or more deck/archetype names through the local archetype table.

POST /translate
Content-Type: application/json

Single-name request:

{
  "name": "No Hand Hunter"
}

Multi-name request:

{
  "names": ["No Hand Hunter", "Big Druid"]
}

GET is also supported:

curl "https://api.blizzcore.ru/translate?name=No%20Hand%20Hunter"

Example response:

{
  "success": true,
  "count": 1,
  "translated": "ЀСйс ΠžΡ…ΠΎΡ‚Π½ΠΈΠΊ",
  "items": [
    {
      "source": "No Hand Hunter",
      "translated": "ЀСйс ΠžΡ…ΠΎΡ‚Π½ΠΈΠΊ"
    }
  ]
}

Recognize Archetype

Recognizes a Hearthstone deck archetype from a deck code. HSGuru is used as the primary source.

POST /archetype
Content-Type: application/json

Request body:

{
  "deck_code": "AAEC..."
}

GET is also supported:

curl "https://api.blizzcore.ru/archetype?deck_code=AAEC..."

Accepted query aliases:

  • deck_code
  • deck

Example response:

{
  "success": true,
  "source": "hsguru_cloudscraper",
  "cached": false,
  "deck_code": "AAEC...",
  "archetype": "ЀСйс ΠžΡ…ΠΎΡ‚Π½ΠΈΠΊ",
  "archetype_raw": "No Hand Hunter",
  "deck_name_raw": "No Hand Hunter",
  "class": "",
  "format": "",
  "translation": "exact",
  "error": null
}

Response fields:

Field Type Description
success boolean Whether recognition succeeded
source string Data source, for example hsguru_cloudscraper or cache
cached boolean Whether the response came from local cache
deck_code string Original deck code
archetype string Translated archetype if available, otherwise raw HSGuru name
archetype_raw string Raw archetype returned by HSGuru
deck_name_raw string Raw deck name returned by HSGuru
class string Class if returned by source
format string Format if returned by source
translation string exact, partial, or none
error string or null Error message when success is false

List Archetype Translations

Returns the local EN -> RU archetype translation table.

curl "https://api.blizzcore.ru/archetypes?search=hunter&limit=50"

Query parameters:

Parameter Type Default Description
search string empty Optional substring filter
limit integer 200 Number of rows, from 1 to 500

Example response:

{
  "success": true,
  "count": 1,
  "items": [
    {
      "id": 16,
      "name_en": "no hand hunter",
      "name_ru": "ЀСйс ΠžΡ…ΠΎΡ‚Π½ΠΈΠΊ"
    }
  ]
}

Versioned Endpoints

Every public endpoint is also available under /v1.

Examples:

curl https://api.blizzcore.ru/v1/health
curl "https://api.blizzcore.ru/v1/archetype?deck_code=AAEC..."
curl -X POST https://api.blizzcore.ru/v1/render \
  -H "Content-Type: application/json" \
  --data '{"deck_code":"AAEC..."}'

The legacy path is also available for compatibility:

https://api.blizzcore.ru/deckview-api/v1

Static Images

/render returns an image_url like:

https://api.blizzcore.ru/static/generated/deck_20260526_214630_574807.jpg

Generated images are served from /static/generated/....

Errors

Common HTTP statuses:

Status Meaning
200 Success
400 Required parameter is missing
401 Private endpoint requires authorization
405 Method is not allowed
422 Deck code could not be rendered
429 Rate limit exceeded
500 Internal server error
504 Render timed out

Error response example:

{
  "success": false,
  "error": "deck_code required"
}

WordPress Example

Minimal shortcode-style browser usage:

<form id="deck-form">
  <textarea name="deck_code" placeholder="Paste Hearthstone deck code"></textarea>
  <button type="submit">Render</button>
</form>
<img id="deck-image" alt="" />

<script>
document.querySelector("#deck-form").addEventListener("submit", async (event) => {
  event.preventDefault();
  const deckCode = event.target.deck_code.value.trim();

  const response = await fetch("https://api.blizzcore.ru/render", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ deck_code: deckCode })
  });

  const result = await response.json();
  if (!result.success) {
    alert(result.error || "Render failed");
    return;
  }

  document.querySelector("#deck-image").src = result.image_url;
});
</script>

Public Contract

The stable public surface is:

https://api.blizzcore.ru/health
https://api.blizzcore.ru/render
https://api.blizzcore.ru/translate
https://api.blizzcore.ru/archetype
https://api.blizzcore.ru/archetypes

Do not rely on private publishing endpoints for public integrations.

About

πŸƒ Telegram-Π±ΠΎΡ‚ ΠΈ HTTP API для Π²ΠΈΠ·ΡƒΠ°Π»ΠΈΠ·Π°Ρ†ΠΈΠΈ ΠΊΠΎΠ»ΠΎΠ΄ Hearthstone. Авто-распознаваниС ΠΊΠΎΠ΄ΠΎΠ², Ρ€Π΅Π½Π΄Π΅Ρ€ ΠΈΠ·ΠΎΠ±Ρ€Π°ΠΆΠ΅Π½ΠΈΠΉ, публикация Π½Π° сайт ΠΈ Π² ΠΊΠ°Π½Π°Π».

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors