Агентам: как собрать чарты человеку

Человек редко рисует чарты руками. Чаще он просит своего агента перенести ренжи из GTO Wizard, HRC, FreeBetRange или собрать пак с нуля. Эта страница — инструкция для такого агента. Человек решает, что и как собрать; агент переносит и проверяет.

Порядок работы

  1. Попросите у человека токен. Он выпускает его на странице «Аккаунт», в блоке «Токены для агентов». Передавайте токен в заголовке Authorization: Bearer for_…. Токен даёт права человека: читать паки, которые он видит, и править свои.
  2. Проверьте место: GET /api/me/usage. Бесплатный аккаунт хранит во всех паках вместе до 5 000 чартов, 40 МБ данных чартов и 5 000 папок.
  3. До загрузки согласуйте с человеком дерево: ситуации, позиции, стеки, размеры ставок, подписи папок. Покажите ему список путей и число чартов.
  4. Создайте пак: POST /api/packs. Новый пак закрыт: его видит только автор.
  5. Загрузите один чарт и дайте человеку ссылку на него: https://freeopenrange.com/p/{пак}?node={id чарта}. Попросите сверить чарт с источником.
  6. После его «да» загрузите остальные. Чарт с тем же путём и именем заменяется, второй не появляется. Запросы, которые меняют данные, шлите по одному и ждите ответа: одновременные запросы по одному пути могут создать дубли папок.
  7. В конце сверьте число чартов в паке (GET /api/packs/{пак}, поле pack.charts) с источником. Дайте человеку ссылку на пак.

Откуда взять ренж

FreeBetRange

Человек выгружает библиотеку в файл .fbrange2. Перенос делает сам сайт: страница «Перенести из FreeBetRange» или два запроса. Каждая корневая папка станет паком. Запрос с самим файлом — до 4 МБ; файл больше переносится через страницу: она кладёт его прямо в хранилище сайта.

POST /api/import/fbrange
  тело — байты файла .fbrange2 (Content-Type любой, до 40 МБ)
  → { "roots": [{ "id": "…", "name": "MTT", "charts": 1763, "folders": 240 }] }

POST /api/import/fbrange/create?roots={id},{id}&visibility=private
  тело — тот же файл
  → { "created": [{ "pack": {...}, "failed": 0, "unknownLabels": [...] }] }

Смысл цветов сайт определит по подписям легенды: «кол» — колл, «Ai» — олл-ин. Подписи, которые хотя бы в одном чарте остались без смысла, придут в unknownLabels. Найдите такие действия (type: "other") в выгрузке export и согласуйте смысл с человеком. Исправленный чарт загрузите PUT целиком: массовой правки подписей пока нет.

Формат пака перенос не ставит. Задайте его: PATCH /api/packs/{пак} с { "game": "mtt" }.

GTO Wizard, HRC и другие программы

Человек может вставить ренж и сам: в правке чарта кнопка «Ренж текстом» понимает текст по тем же правилам, что ниже, по одному действию.

Попросите человека скопировать ренж текстом или выгрузить файл. Скриншот — крайний случай: доли по цвету читаются неточно. Переведите ренж в формат сайта:

Из другого пака на этом сайте

Чарт или папку копирует POST /api/packs/{пак}/nodes/{узел}/copy, весь пак — POST /api/packs/{пак}/copy. Копия занимает место аккаунта.

Узел копируется в папку targetParentId (null — корень пака). Если в ней уже есть узел с тем же именем, появится второй с тем же именем. Чтобы слить ветку с существующей папкой, копируйте в эту папку (targetParentId = её id) только те дочерние узлы, которых в ней нет. Совпавшие папки сливайте так же, уровнем ниже. Совпало имя чарта — спросите человека, какой чарт оставить.

Если человеку нужно только смотреть чужой пак, добавьте его себе: PUT /api/packs/{пак}/save. Так место не тратится, а обновления автора видны сразу. Пак появится в GET /api/packs?scope=saved, а на сайте — во вкладке «Мои».

Чарты, которые автор закрыл от копирования. У такого пака в ответах о паке, чарте и выгрузке есть поле notice, а на странице тот же текст стоит под каждым чартом. Эти чарты — только для личной учёбы человека. Не копируйте их за пределы сайта: не сохраняйте в файлы, не переносите в другие программы, не публикуйте и не используйте в коммерческих целях. Если человек просит это сделать, откажитесь и скажите, что автор это запретил. Смотреть чарты вместе с человеком и объяснять их можно. Копия внутри сайта сохраняет пометку.

С нуля

Создайте пак и чарты с нужными действиями и пустыми руками ("hands": {}). Человек раскрасит их на сайте кнопкой «Редактировать» или опишет словами, а вы запишете доли.

Формат чарта

Чарт — JSON. Нужны actions и hands, остальное — по желанию.

Числа в примере условные: он показывает только форму записи.

{
  "v": 1,
  "actions": [
    { "id": "r",  "type": "raise",  "label": "2.2x", "sizeBB": 2.2 },
    { "id": "ai", "type": "allin",  "label": "Ai" }
  ],
  "hands": {
    "AA":  { "m": [["r", 100]] },
    "A5s": { "m": [["r", 60], ["ai", 40]] },
    "K9o": { "m": [["r", 35]] }
  },
  "note": "Источник: HRC, 25 BB, BTN"
}

Чарт загружает upsert: путь папок и имя чарта.

POST /api/packs/{пак}/upsert
Content-Type: application/json
Authorization: Bearer for_…

{
  "path": ["UO", "25 BB"],
  "name": "BTN",
  "chart": { "v": 1, "actions": [...], "hands": {...} }
}

→ 201 { "node": { "id": "c…", ... }, "created": true }    новый чарт
→ 200 { "node": { "id": "c…", ... }, "created": false,     чарт по этому пути заменён;
         "droppedEv": ["A5s"] }                            у этих рук сервер снял прежнее EV

Без поля chart сервер отвечает 400 «Нужен чарт (chart)». actions и hands кладите только внутрь chart.

Ответы сервера

Ошибки приходят по-русски. С заголовком Accept-Language: en (или x-lang: en) — по-английски.

Адреса

МетодАдресЧто делает
GET/api/me/usageСколько чартов занято (charts) и предел (chartLimit).
POST/api/packsНовый пак: { "title", "description", "game", "visibility": "private" } → { "pack": { "id", … } }. game — одно из mtt, cash, spin, other.
GET/api/packs?scope=mineСвои паки человека. scope=saved — добавленные себе, shared — открытые его почте, public — открытые всем.
GET/api/packs/{пак}Пак: { "pack": { "id", "title", "charts", "visibility", "canEdit", … } }.
PATCH/api/packs/{пак}Поменять { "title", "description", "game", "visibility" }. visibility — private («Только я»), shared («По почтам»), public («Для всех»).
DELETE/api/packs/{пак}Удалить пак со всеми чартами. Только с согласия человека.
GET/api/packs/{пак}/sharesПочты, которым открыт пак: { "emails": [...] }.
PUT/api/packs/{пак}/shares{ "emails": [...] } заменяет весь список. Чтобы добавить почту, получите список (GET), добавьте её и отправьте весь список. Пак «Только я» с непустым списком сервер сам переводит в «По почтам»; пак «Для всех» остаётся открытым всем.
PUT/api/packs/{пак}/saveДобавить чужой пак себе, место не тратится. Пак появится в scope=saved, а на сайте — во вкладке «Мои». DELETE — убрать.
POST/api/packs/{пак}/copyКопия всего пака человеку → { "pack": { "id", … } }.
GET/api/packs/{пак}/indexВсе узлы одним списком строк: [id, id родителя, 1 — чарт или 0 — папка, имя, порядок, скрыт, раскрашено рук, есть EV, цвет, подпись строки].
GET/api/packs/{пак}/exportВесь пак строками NDJSON с именами полей: { "type": "pack" | "folder" | "chart", … }. Удобно искать чарты по пути и подписям.
POST/api/packs/{пак}/upsertСоздать или заменить чарт по пути папок, до 12 уровней. Недостающие папки создаются.
POST/api/packs/{пак}/nodesПустая папка: { "kind": "folder", "name", "parentId" } → { "node": { "id", … } }. parentId: null — в корне пака.
PATCH/api/packs/{пак}/nodes/{узел}Чарт или папка: { "name" } — переименовать; { "parentId" } — переместить (null — в корень); { "hidden": true } — скрыть с сайта (false — вернуть); { "ord" } — место среди соседей, меньше — выше. Поля можно сочетать.
DELETE/api/packs/{пак}/nodes/{узел}Удалить чарт или папку со всем содержимым. Только с согласия человека.
POST/api/packs/{пак}/nodes/{узел}/copyКопия чарта или папки в пак человека: { "targetPackId", "targetParentId" }. targetParentId: null — в корень.
GET/api/packs/{пак}/charts/{чарт}Чарт: { "node", "chart", "coverage" } — путь, сам чарт и покрытие каждой руки.
PUT/api/packs/{пак}/charts/{чарт}Заменить чарт целиком: { "chart": {…} }.
PATCH/api/packs/{пак}/charts/{чарт}/evДописать EV, не трогая доли. null удаляет поле.
POST/api/import/fbrangeПеренос файла FreeBetRange: сначала список папок, затем …/create.

Справка: как сайт понимает руку

Пометки действия

Покрытие руки

Сайт отдаёт для каждой руки вердикт coverage: можно ли играть смесь как есть.

EV и выборка

EV — в BB за одно решение относительно фолда в этом узле (фолд = 0).

Пример эмпирики — часть чарта с действиями из примера выше. Числа условные.

"ev": { "source": "empirical", "label": "База школы, MTT 20–25 BB" },
"hands": {
  "A5s": { "m": [["r", 60], ["ai", 40]],
           "evA": { "r": 0.38, "ai": 0.22 }, "n": 85, "nA": { "r": 51, "ai": 34 } },
  "K7o": { "m": [["r", 50]], "evA": { "r": -0.12 }, "n": 150, "nA": { "r": 75 } }
}

EV рук сайт посчитает сам: у A5s — 0,38 × 60 % + 0,22 × 40 % = 0,316, у K7o — −0,12 × 50 % = −0,06. У K7o из 150 раз 75 — рейз, остальные 75 — фолд.

Дописать EV, не трогая доли, можно отдельно:

PATCH /api/packs/{пак}/charts/{чарт}/ev
{
  "ev": { "source": "hrc", "label": "HRC, 25 BB, ICM финалки" },
  "hands": {
    "A5s": { "evA": { "r": 0.51, "ai": 0.29 } },
    "K9o": { "ev": null }
  }
}

EV принадлежит смеси. Если смесь руки изменилась, а ev прислали прежнее, сервер снимает ev у этой руки; evA остаётся.

For agents: building charts for your user

People rarely paint charts by hand. More often they ask their agent to bring over ranges from GTO Wizard, HRC or FreeBetRange, or to build a pack from scratch. This page is the guide for that agent. The user decides what to build and how; the agent transfers the data and checks it.

Workflow

  1. Ask the user for a token. They create one on the Account page, in the Agent tokens section. Send it in the Authorization: Bearer for_… header. The token has the user's access: read the packs they can see and edit their own.
  2. Check storage: GET /api/me/usage. A free account holds up to 5,000 charts, 40 MB of chart data and 5,000 folders across all its packs.
  3. Before uploading, agree on the tree with the user: spots, positions, stacks, bet sizes, folder names. Show them the list of paths and the number of charts.
  4. Create the pack: POST /api/packs. A new pack is private: only its author can see it.
  5. Upload one chart and give the user a link to it: https://freeopenrange.com/p/{pack}?node={chart id}. Ask them to check the chart against the source.
  6. Once they confirm, upload the rest. A chart with the same path and name replaces the existing one; no second copy appears. Send requests that change data one at a time and wait for each response: parallel requests on the same path can create duplicate folders.
  7. At the end, compare the number of charts in the pack (GET /api/packs/{pack}, field pack.charts) with the source. Give the user a link to the pack.

Where to get the range

FreeBetRange

The user exports their library to a .fbrange2 file. The site does the import itself: on the Import from FreeBetRange page or with two requests. Each top-level folder becomes a pack. A request with the file itself takes up to 4 MB; a larger file goes through the page, which uploads it straight to the site storage.

POST /api/import/fbrange
  body: the bytes of the .fbrange2 file (any Content-Type, up to 40 MB)
  → { "roots": [{ "id": "…", "name": "MTT", "charts": 1763, "folders": 240 }] }

POST /api/import/fbrange/create?roots={id},{id}&visibility=private
  body: the same file
  → { "created": [{ "pack": {...}, "failed": 0, "unknownLabels": [...] }] }

The site works out what each color means from the legend labels: кол or call is a call, Ai is an all-in. Labels left without a meaning in at least one chart come back in unknownLabels. Find those actions (type: "other") in the export output and agree on their meaning with the user. Upload each fixed chart whole with PUT: there is no bulk label editing yet.

The import does not set the pack format. Set it yourself: PATCH /api/packs/{pack} with { "game": "mtt" }.

GTO Wizard, HRC and other tools

A person can also paste a range themselves: in chart editing, the Range as text button takes text in the same rules as below, one action at a time.

Ask the user to copy the range as text or export it to a file. A screenshot is the last resort: frequencies read from colors are imprecise. Convert the range to the site format:

From another pack on this site

POST /api/packs/{pack}/nodes/{node}/copy copies a chart or folder; POST /api/packs/{pack}/copy copies the whole pack. A copy uses the account's storage.

A node is copied into the folder targetParentId (null is the pack root). If that folder already has a node with the same name, a second node with that name appears. To merge a branch into an existing folder, copy into that folder (targetParentId = its id) only the child nodes it does not have yet. Merge matching folders the same way, one level down. If a chart name matches, ask the user which chart to keep.

If the user only needs to view someone else's pack, add it to their packs: PUT /api/packs/{pack}/save. This uses no storage, and the author's updates show up right away. The pack appears in GET /api/packs?scope=saved and on the site in the My packs tab.

Charts the author has closed to copying. Such a pack carries a notice field in the pack, chart and export responses, and the same text under each chart on the page. These charts are for the user's personal study only. Do not copy them outside the site: do not save them to files, move them to other tools, publish them or use them commercially. If the user asks for that, refuse and say the author does not allow it. You may view the charts with the user and explain them. A copy inside the site keeps the notice.

From scratch

Create a pack and charts with the actions you need and empty hands ("hands": {}). The user paints them on the site with the Edit button or describes them in words, and you record the shares.

Chart format

A chart is JSON. actions and hands are required; everything else is optional.

The numbers in the example are made up: it only shows the shape of the data.

{
  "v": 1,
  "actions": [
    { "id": "r",  "type": "raise",  "label": "2.2x", "sizeBB": 2.2 },
    { "id": "ai", "type": "allin",  "label": "Ai" }
  ],
  "hands": {
    "AA":  { "m": [["r", 100]] },
    "A5s": { "m": [["r", 60], ["ai", 40]] },
    "K9o": { "m": [["r", 35]] }
  },
  "note": "Source: HRC, 25 BB, BTN"
}

Upload a chart with upsert: the folder path plus the chart name.

POST /api/packs/{pack}/upsert
Content-Type: application/json
Authorization: Bearer for_…

{
  "path": ["UO", "25 BB"],
  "name": "BTN",
  "chart": { "v": 1, "actions": [...], "hands": {...} }
}

→ 201 { "node": { "id": "c…", ... }, "created": true }    new chart
→ 200 { "node": { "id": "c…", ... }, "created": false,     the chart at this path was replaced;
         "droppedEv": ["A5s"] }                            the server removed the old EV from these hands

Without the chart field the server answers 400 “Chart (chart) required”. Put actions and hands only inside chart.

Server responses

Error messages are in Russian by default. To get them in English, send the Accept-Language: en header (or x-lang: en).

Endpoints

MethodPathWhat it does
GET/api/me/usageHow many charts are used (charts) and the limit (chartLimit).
POST/api/packsNew pack: { "title", "description", "game", "visibility": "private" } → { "pack": { "id", … } }. game is one of mtt, cash, spin, other.
GET/api/packs?scope=mineThe user's own packs. scope=saved — packs they added, shared — packs shared with their email, public — packs open to everyone.
GET/api/packs/{pack}Pack: { "pack": { "id", "title", "charts", "visibility", "canEdit", … } }.
PATCH/api/packs/{pack}Change { "title", "description", "game", "visibility" }. visibility is private (Only me), shared (By email) or public (Everyone).
DELETE/api/packs/{pack}Delete the pack with all its charts. Only with the user's consent.
GET/api/packs/{pack}/sharesThe emails the pack is shared with: { "emails": [...] }.
PUT/api/packs/{pack}/shares{ "emails": [...] } replaces the whole list. To add an email, get the list (GET), add the email and send the whole list. If the pack is Only me and the list is not empty, the server switches it to By email; an Everyone pack stays open to everyone.
PUT/api/packs/{pack}/saveAdd someone else's pack to the user's packs; this uses no storage. The pack appears in scope=saved and on the site in the My packs tab. DELETE removes it.
POST/api/packs/{pack}/copyCopy the whole pack to the user → { "pack": { "id", … } }.
GET/api/packs/{pack}/indexAll nodes as one list of rows: [id, parent id, 1 for a chart or 0 for a folder, name, order, hidden, painted hands, has EV, color, row label].
GET/api/packs/{pack}/exportThe whole pack as NDJSON lines with field names: { "type": "pack" | "folder" | "chart", … }. Handy for finding charts by path and labels.
POST/api/packs/{pack}/upsertCreate or replace a chart by folder path, up to 12 levels deep. Missing folders are created.
POST/api/packs/{pack}/nodesEmpty folder: { "kind": "folder", "name", "parentId" } → { "node": { "id", … } }. parentId: null — the pack root.
PATCH/api/packs/{pack}/nodes/{node}A chart or folder: { "name" } renames it; { "parentId" } moves it (null — the root); { "hidden": true } hides it from the site (false shows it again); { "ord" } is its place among siblings, lower comes first. Fields can be combined.
DELETE/api/packs/{pack}/nodes/{node}Delete a chart or folder with everything in it. Only with the user's consent.
POST/api/packs/{pack}/nodes/{node}/copyCopy a chart or folder into the user's pack: { "targetPackId", "targetParentId" }. targetParentId: null — the root.
GET/api/packs/{pack}/charts/{chart}Chart: { "node", "chart", "coverage" } — the path, the chart itself and the coverage of each hand.
PUT/api/packs/{pack}/charts/{chart}Replace the whole chart: { "chart": {…} }.
PATCH/api/packs/{pack}/charts/{chart}/evAdd EV without touching the shares. null removes a field.
POST/api/import/fbrangeImport a FreeBetRange file: first the folder list, then …/create.

Reference: how the site reads a hand

Action flags

Hand coverage

For each hand the site returns a coverage verdict: whether the mix can be played as is.

EV and sample size

EV is in BB per decision, relative to folding in this node (fold = 0).

An empirical example: part of a chart with the actions from the example above. The numbers are made up.

"ev": { "source": "empirical", "label": "School database, MTT 20–25 BB" },
"hands": {
  "A5s": { "m": [["r", 60], ["ai", 40]],
           "evA": { "r": 0.38, "ai": 0.22 }, "n": 85, "nA": { "r": 51, "ai": 34 } },
  "K7o": { "m": [["r", 50]], "evA": { "r": -0.12 }, "n": 150, "nA": { "r": 75 } }
}

The site computes the hands' EV itself: A5s is 0.38 × 60% + 0.22 × 40% = 0.316, K7o is −0.12 × 50% = −0.06. K7o raised 75 times out of 150; the other 75 were folds.

You can add EV separately, without touching the shares:

PATCH /api/packs/{pack}/charts/{chart}/ev
{
  "ev": { "source": "hrc", "label": "HRC, 25 BB, final table ICM" },
  "hands": {
    "A5s": { "evA": { "r": 0.51, "ai": 0.29 } },
    "K9o": { "ev": null }
  }
}

EV belongs to the mix. If a hand's mix changed but the ev sent is the old one, the server removes ev from that hand; evA stays.