api.byfox.dev
Общий источник данных для проектов byFox: гео-базы и шаблоны правил. Всё собирается здесь раз в сутки из первоисточников — клиентам не нужно ходить на GitHub и в MaxMind.
Сейчас: GeoLite2 —, шаблонов — (каталог от —), сводка обновлена —.
Как понять, что пора обновиться
- Раз в
check.interval_hours(сейчас 24 ч, не чащеcheck.min_interval_hours) скачайте/manifest.json— 1–2 КБ. - Сравните дату нужного продукта с сохранённой у себя:
geo.geolite2.date(YYYYMMDD),geo.countries.date,geo.lists.date,rule.date(YYYY-MM-DD). - Дата новее — скачайте манифест сервиса (
geo/manifest.json,rule/manifest.json): там размеры иsha256каждого файла. Качайте только изменившиеся, проверяйте sha256 до замены.
Даты меняются только при изменении содержимого: повторная сборка без новых данных ничего не трогает.
nginx отдаёт ETag/Last-Modified — условные запросы (If-None-Match) работают.
/manifest.json
{
"updated": "2026-11-03T08:35:08Z",
"check": {"interval_hours": 24, "min_interval_hours": 6},
"mirrors": ["https://api.byfox.dev/"],
"geo": {"geolite2": {"date": "20261101"}, "countries": {"date": "20261101"},
"lists": {"date": "2026-11-03"}, "manifest": "geo/manifest.json"},
"rule": {"date": "2026-11-03", "count": 702, "bm7_date": "2026-10-27", "manifest": "rule/manifest.json"}
}
mirrors — базовые URL в порядке предпочтения. Все пути в API относительные: если первый адрес
не отвечает, клиент пробует следующий, без нового релиза.
Правила для клиентов
- User-Agent
<проект>/<версия>(напримерMomLauncher/1.4.2) — по нему видно, кто пользуется и кто давно не обновлялся. - Не чаще
min_interval_hoursдля манифеста; большие файлы — только при смене даты. - CORS открыт (
Access-Control-Allow-Origin: *) — можно читать из браузера. - Для
.jsonесть готовый gzip: заголовокAccept-Encoding: gzip.
Примеры
# что свежее
curl -s https://api.byfox.dev/manifest.json
# GeoLite2 City с проверкой sha256
curl -sO https://api.byfox.dev/geo/GeoLite2-City.mmdb
curl -s https://api.byfox.dev/geo/manifest.json | jq -r '.geolite2.files["GeoLite2-City.mmdb"].sha256'
sha256sum GeoLite2-City.mmdb
# каталог шаблонов и URL Clash-файла Telegram
curl -s --compressed https://api.byfox.dev/rule/templates.json \
| jq -r '.items[] | select(.id=="Telegram") | "https://api.byfox.dev/rule/" + .files.clash'
Старые адреса
| Было | Стало |
|---|---|
byfox.dev/data/maxmind/*.mmdb, countries.zip, geolite2_data.txt | api.byfox.dev/geo/… (те же имена и форматы) |
byfox.dev/data/maxmind/blackmatrix7.txt, blackmatrix7+www.txt | api.byfox.dev/rule/… |
byfox.dev/data/awg-panel/rules/<имя>/…, folders.txt | api.byfox.dev/rule/byfox/<имя>/…, rule/folders.txt |
raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/… | api.byfox.dev/rule/bm7/… (замена префикса) |
Старые адреса на byfox.dev отвечают 301 на новые, пока все проекты не переедут.
A shared data source for byFox projects: geo databases and rule templates. Everything is rebuilt here daily from the original sources, so clients never need to reach GitHub or MaxMind.
Now: GeoLite2 —, — templates (catalog of —), summary updated —.
When to update
- Every
check.interval_hours(24 h now, never more often thancheck.min_interval_hours) fetch/manifest.json— 1–2 KB. - Compare the product's date with the one you stored:
geo.geolite2.date(YYYYMMDD),geo.countries.date,geo.lists.date,rule.date(YYYY-MM-DD). - If it is newer, fetch the service manifest (
geo/manifest.json,rule/manifest.json): it lists the size andsha256of every file. Download only what changed and verify sha256 before replacing.
Dates change only when content changes; a rebuild with no new data touches nothing.
nginx sends ETag/Last-Modified, so conditional requests (If-None-Match) work.
/manifest.json
{
"updated": "2026-11-03T08:35:08Z",
"check": {"interval_hours": 24, "min_interval_hours": 6},
"mirrors": ["https://api.byfox.dev/"],
"geo": {"geolite2": {"date": "20261101"}, "countries": {"date": "20261101"},
"lists": {"date": "2026-11-03"}, "manifest": "geo/manifest.json"},
"rule": {"date": "2026-11-03", "count": 702, "bm7_date": "2026-10-27", "manifest": "rule/manifest.json"}
}
mirrors are base URLs in order of preference. All API paths are relative: if the first one is down,
a client tries the next, no new release needed.
Client rules
- User-Agent
<project>/<version>(e.g.MomLauncher/1.4.2) so we can see who uses the API and who has not updated for a while. - The manifest no more often than
min_interval_hours; big files only when the date changes. - CORS is open (
Access-Control-Allow-Origin: *), browsers can read it. .jsonfiles are pre-gzipped: sendAccept-Encoding: gzip.
Examples
# what is fresh
curl -s https://api.byfox.dev/manifest.json
# GeoLite2 City with a sha256 check
curl -sO https://api.byfox.dev/geo/GeoLite2-City.mmdb
curl -s https://api.byfox.dev/geo/manifest.json | jq -r '.geolite2.files["GeoLite2-City.mmdb"].sha256'
sha256sum GeoLite2-City.mmdb
# template catalog and the Clash file URL for Telegram
curl -s --compressed https://api.byfox.dev/rule/templates.json \
| jq -r '.items[] | select(.id=="Telegram") | "https://api.byfox.dev/rule/" + .files.clash'
Old URLs
| Old | New |
|---|---|
byfox.dev/data/maxmind/*.mmdb, countries.zip, geolite2_data.txt | api.byfox.dev/geo/… (same names and formats) |
byfox.dev/data/maxmind/blackmatrix7.txt, blackmatrix7+www.txt | api.byfox.dev/rule/… |
byfox.dev/data/awg-panel/rules/<name>/…, folders.txt | api.byfox.dev/rule/byfox/<name>/…, rule/folders.txt |
raw.githubusercontent.com/blackmatrix7/ios_rule_script/master/rule/… | api.byfox.dev/rule/bm7/… (prefix swap) |
The old byfox.dev URLs answer 301 to the new ones until every project has moved.