Decode Bencode to a JSON value
API · /bencode-api
Bencode API
Encode and decode Bencode (BEP 3) — the serialization format BitTorrent uses for .torrent metainfo files and tracker responses. The encode endpoint turns a JSON value into Bencode: objects become dictionaries with their keys sorted in raw byte order exactly as the spec demands, arrays become lists, whole numbers become integers, and strings become length-prefixed byte strings. The decode endpoint parses Bencode back into a JSON value and enforces the spec strictly — no leading zeros in integers, no negative zero, dictionary keys must be sorted and unique, and no trailing data is tolerated — so malformed input is rejected rather than silently mangled. Binary byte strings that are not valid UTF-8 are represented losslessly as a {"_bytes_hex":"…"} object, so encode and decode round-trip exactly even for the binary "pieces" field of a real torrent. Decode accepts the data either as text or, for genuinely binary payloads, as hex; encode returns both the Bencode text (when printable) and its hex bytes. Everything is computed locally and deterministically, so it is instant and private. Ideal for building and parsing .torrent files, tracker tooling, BitTorrent clients and DHT messages, and teaching how the format works. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is BitTorrent's Bencode specifically; for base64, hex, URL or HTML encoding use a general encoding API, and for JSON, YAML, TOML or XML use those format APIs.
API health
healthy- Uptime
- 100.00%
- Server probes · 24h
- Avg latency
- 350 ms
- Server probes · 24h
- Subscribers
- 4,713
- active
- Total calls
- 39
- last 7 days
Pricing
Pick a tier — billed monthly, cancel anytime.
Free
Free
- 5,335 calls / month
- 2 requests / second
- Hard cap (429 above quota, no overage)
- 5,335 calls/month
- 2 req/sec
- Encode + decode
- No credit card
Starter
€6.85 /month
- 14,850 calls / month
- 8 requests / second
- Hard cap (429 above quota, no overage)
- 14.85k calls/month
- 8 req/sec
- Binary-safe (hex) round-trip
- Email support
Pro
€26.75 /month
- 199,500 calls / month
- 20 requests / second
- Hard cap (429 above quota, no overage)
- 199.5k calls/month
- 20 req/sec
- Torrent / tracker pipelines
- Priority support
Mega
€64.75 /month
- 1,040,000 calls / month
- 50 requests / second
- Hard cap (429 above quota, no overage)
- 1.04M calls/month
- 50 req/sec
- Platform scale
- Dedicated SLA
Built by
Related APIs
Other APIs with overlapping tags.
CBOR API
Encode and decode CBOR (RFC 8949, Concise Binary Object Representation) — the IETF-standard binary data format behind COSE, WebAuthn/FIDO2, the EU Digital COVID Certificate, and many IoT and constrained-device protocols. The encode endpoint turns a JSON value into compact, definite-length CBOR, choosing the smallest head for each integer, string, array and map; the decode endpoint parses CBOR back into a JSON value. It implements the spec across all major types — unsigned and negative integers of every width, byte and text strings (including indefinite-length chunked strings), arrays, maps, tags, the simple values false/true/null, and half-, single- and double-precision floats — and rejects trailing or truncated data rather than silently mangling it. Byte strings and any non-UTF-8 text come back losslessly as {"_bytes_hex":"…"}, tags as {"_tag":{"tag":N,"value":…}}, non-finite floats as {"_float":"NaN|Infinity|-Infinity"}, and other simple values as {"_simple":N}, so encode and decode round-trip exactly. Bytes are exchanged as both hex and base64 so they survive any transport. Everything is computed locally and deterministically, so it is instant and private. Ideal for debugging CBOR, COSE and WebAuthn payloads, bridging JSON and CBOR systems, IoT and smart-card pipelines, and teaching the format. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is CBOR specifically; for MessagePack use the MessagePack API, for BitTorrent's Bencode use the Bencode API, for JSON, YAML, TOML or XML use those format APIs, and for base64, hex, URL or HTML encoding use a general encoding API.
api.oanor.com/cbor-api
MessagePack API
Encode and decode MessagePack — the compact binary serialization format ("it's like JSON, but fast and small") used by Redis, Fluentd, many RPC systems and IoT protocols. The encode endpoint turns a JSON value into MessagePack bytes, automatically choosing the smallest representation for each integer, string, array and map; the decode endpoint parses MessagePack back into a JSON value. It implements the full spec — nil, booleans, every fixed and variable integer width, float32 and float64, str and bin, arrays and maps, and the ext family — and rejects trailing or truncated data rather than silently mangling it. Binary (bin) values and any non-UTF-8 string come back losslessly as a {"_bytes_hex":"…"} object, and ext values as {"_ext":{"type":N,"hex":"…"}}, so encode and decode round-trip exactly. Bytes are exchanged as both hex and base64 so they survive any transport. Everything is computed locally and deterministically, so it is instant and private. Ideal for debugging MessagePack payloads, bridging JSON and msgpack systems, RPC and cache tooling, IoT pipelines, and teaching the format. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This is MessagePack specifically; for JSON, YAML, TOML or XML use those format APIs, for BitTorrent's Bencode use the Bencode API, and for base64, hex, URL or HTML encoding use a general encoding API.
api.oanor.com/msgpack-api
Elevator Traction API
Traction-elevator engineering maths as an API, computed locally and deterministically — the counterweight, hoist-motor and rope-traction numbers a lift engineer or building-services designer sizes a passenger elevator with. The counterweight endpoint gives the balancing mass = the empty car plus a fraction of the rated load (the overbalance, typically 40–50 %, 45 % common), so a 1,000 kg car rated for 1,000 kg uses a 1,450 kg counterweight — the car and weight balance near half load and the machine is sized for the worst-case imbalance, not the full load. The motor-power endpoint uses that: because the counterweight cancels most of the car, the motor only lifts the out-of-balance load = rated load × (1 − overbalance), so power = that × g × speed ÷ efficiency (~65–75 % geared) — a 1,000 kg lift at 1.5 m/s needs only about 11–12 kW, half what a counterweight-less hoist would draw. The traction-ratio endpoint checks the friction grip: a traction elevator moves the ropes by friction over the sheave, so the available traction (e^(μθ), the capstan equation) must beat the T1/T2 tension ratio at both worst cases — a full car at the bottom and an empty car at the top — and it returns the governing ratio. Everything is computed locally and deterministically, so it is instant and private. Ideal for lift-design and building-services tools, vertical-transport and MEP utilities, and engineering calculators. Pure local computation — no key, no third-party service, instant. Sizing estimates — follow the lift code and maker data. 3 compute endpoints. For block-and-tackle use a pulley API; for capstan friction a capstan API.
api.oanor.com/elevator-api
Railway Tractive Effort API
Railway train-performance maths as an API, computed locally and deterministically — the tractive-effort, resistance and adhesion numbers a railway engineer, train planner or rail-sim developer rates motive power with. The tractive-effort endpoint gives the pulling force a locomotive develops = 375 × horsepower × efficiency ÷ speed (mph), the classic hyperbolic curve where a constant-power loco pulls hardest at low speed and tapers as it accelerates — 4,000 hp at 25 mph and 82 % efficiency is about 49,200 lbf at the rail. The resistance endpoint gives the forces a train fights: grade resistance ≈ 20 lb per ton per 1 % of grade (the weight component along the slope, the dominant force on a hill — a 5,000-ton train on a 1 % grade fights 100,000 lbf) plus curve resistance ≈ 0.8 lb per ton per degree of curve from flange friction. The adhesion endpoint gives the hard ceiling: however much power a loco has, it can only pull as hard as the wheels grip — maximum starting tractive effort = the adhesion coefficient (≈ 0.25 dry, more with sand) × the weight on the driving wheels, so 200 tons on the drivers is about 100,000 lbf before slip. Everything is computed locally and deterministically, so it is instant and private. Ideal for rail-operations and motive-power planning tools, train-simulator and railfan apps, and transport-engineering utilities. Pure local computation — no key, no third-party service, instant. Excludes the speed-dependent Davis rolling/air resistance. 3 compute endpoints. For highway curve geometry use a horizontal-curve API.
api.oanor.com/railway-api
Frequently asked questions
Quick answers about pricing, quotas, and integration.
How do I get an API key for Bencode API?
What's the rate limit for Bencode API?
How much does Bencode API cost?
Can I cancel my subscription anytime?
Is Bencode API GDPR-compliant?
Pick an endpoint from the list on the left to see its details and try it.
Code snippets
Sign up to get an API key, then call any path under your slug.
curl https://api.oanor.com/bencode-api/SOME_PATH \
-H "x-oanor-key: oanor_test_..."
const res = await fetch("https://api.oanor.com/bencode-api/SOME_PATH", {
headers: { "x-oanor-key": "oanor_test_..." }
});
const data = await res.json();
$ch = curl_init("https://api.oanor.com/bencode-api/SOME_PATH");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ["x-oanor-key: oanor_test_..."]);
$response = curl_exec($ch);
import requests
r = requests.get(
"https://api.oanor.com/bencode-api/SOME_PATH",
headers={"x-oanor-key": "oanor_test_..."},
)
print(r.json())
Ratings
Sign in to rate.
No reviews yet.
Discussion
Ask questions, share usage tips, get answers from the provider and other developers. Public — anyone can read.
Sign in to start a thread or reply.
Sign inNew thread
·
-
Provider answer
🔒 This thread is locked — no new replies.
-
·
- No threads yet — start the discussion.
Support
Private 1:1 support with the provider — billing questions, integration issues, account problems. Only you and the provider team can see these threads.
Sign in to open a support ticket.
Sign inOpen new ticket
Describe what you need help with. The provider team gets an email and replies on the ticket page.
-
·
Urgent - No tickets yet for this API.