{"openapi":"3.1.0","info":{"title":"Resistor Color Code API","version":"1.0.0","description":"Read and write resistor colour codes and snap values to the standard E-series. The decode endpoint takes the colour bands of a 3-, 4-, 5- or 6-band resistor and returns the resistance in ohms (nicely formatted as Ω/kΩ/MΩ/GΩ), the significant digits and multiplier, the tolerance, the minimum and maximum resistance that tolerance implies, and — for 6-band parts — the temperature coefficient in ppm/K. The encode endpoint goes the other way: give it a resistance in ohms (and optionally a band count and tolerance) and it returns the colour bands, picking the nearest value representable with the available significant digits. The eseries endpoint snaps any value to the nearest preferred resistor value in the E6, E12, E24, E48 or E96 series and reports the percentage error and the neighbouring preferred values. It uses the standard IEC 60062 colour assignments (including gold ×0.1 and silver ×0.01 multipliers and the implicit ±20% of a 3-band part). Everything is computed locally and deterministically, so it is instant and private. Ideal for electronics design, PCB and BOM work, lab and hobby bench use, repair and reverse-engineering, and teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is for resistor colour codes; for general number formatting use a number-format API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/resistor-api","description":"oanor gateway"}],"tags":[{"name":"Resistor"},{"name":"Meta"}],"components":{"securitySchemes":{"oanorKey":{"type":"apiKey","in":"header","name":"x-oanor-key","description":"Get your key at https://www.oanor.com/developer/keys"}}},"security":[{"oanorKey":[]}],"paths":{"/v1/decode":{"get":{"operationId":"get_v1_decode","tags":["Resistor"],"summary":"Colour bands to resistance","description":"","parameters":[{"name":"bands","in":"query","required":true,"description":"Comma-separated colours","schema":{"type":"string"},"example":"yellow,violet,red,gold"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"ohms":4700,"bands":["yellow","violet","red","gold"],"max_ohms":4935,"min_ohms":4465,"formatted":"4.7 kΩ","band_count":4,"multiplier":100,"tolerance_percent":5,"significant_digits":47},"meta":{"timestamp":"2026-06-03T17:42:16.364Z","request_id":"4ae34783-4253-4429-8588-a124e38a0b34"},"status":"ok","message":"Decode bands","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/encode":{"get":{"operationId":"get_v1_encode","tags":["Resistor"],"summary":"Resistance to colour bands","description":"","parameters":[{"name":"ohms","in":"query","required":true,"description":"Resistance in ohms","schema":{"type":"string"},"example":"4700"},{"name":"bands","in":"query","required":false,"description":"4, 5 or 6 (default 4)","schema":{"type":"string"},"example":"4"},{"name":"tolerance","in":"query","required":false,"description":"Tolerance percent","schema":{"type":"string"},"example":"5"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"ohms":4700,"bands":["yellow","violet","red","gold"],"exact":true,"formatted":"4.7 kΩ","encoded_ohms":4700,"requested_bands":4,"tolerance_percent":5},"meta":{"timestamp":"2026-06-03T17:42:16.460Z","request_id":"3fe14a0c-f97a-4b09-a838-655fd166565a"},"status":"ok","message":"Encode value","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/eseries":{"get":{"operationId":"get_v1_eseries","tags":["Resistor"],"summary":"Nearest preferred value","description":"","parameters":[{"name":"ohms","in":"query","required":true,"description":"Resistance in ohms","schema":{"type":"string"},"example":"4800"},{"name":"series","in":"query","required":false,"description":"E6/E12/E24/E48/E96 (default E24)","schema":{"type":"string"},"example":"E24"}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"ohms":4800,"lower":4300,"higher":5100,"series":"E24","error_percent":-2.083,"nearest_formatted":"4.7 kΩ","nearest_preferred":4700},"meta":{"timestamp":"2026-06-03T17:42:16.570Z","request_id":"6b8fdfc4-51a1-4718-a542-06a2469acfd9"},"status":"ok","message":"E-series","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}},"/v1/meta":{"get":{"operationId":"get_v1_meta","tags":["Meta"],"summary":"Spec","description":"","parameters":[],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"Resistor Color Code API","notes":"Multiplier colours: gold = ×0.1, silver = ×0.01. 3-band resistors imply ±20% tolerance. Nothing is stored.","colours":{"digit":"black0 brown1 red2 orange3 yellow4 green5 blue6 violet7 grey8 white9","tolerance":"brown±1 red±2 green±0.5 blue±0.25 violet±0.1 grey±0.05 gold±5 silver±10 (none ±20)","multiplier":"…gold ×0.1, silver ×0.01"},"version":"v1","endpoints":[{"path":"/v1/decode","params":{"bands":"comma-separated colours, e.g. brown,black,red,gold"},"returns":"resistance, tolerance, min/max, tempco"},{"path":"/v1/encode","params":{"ohms":"resistance in ohms","bands":"4, 5 or 6 (default 4)","tolerance":"percent (default 5 for 4-band, 1 otherwise)"},"returns":"the colour bands"},{"path":"/v1/eseries","params":{"ohms":"resistance in ohms","series":"E6/E12/E24/E48/E96 (default E24)"},"returns":"nearest preferred value + error"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Read and write resistor colour codes and snap values to the standard E-series. The decode endpoint takes the colour bands of a 3-, 4-, 5- or 6-band resistor and returns the resistance in ohms (nicely formatted as Ω/kΩ/MΩ/GΩ), the significant digits and multiplier, the tolerance, the min/max resistance that tolerance implies, and — for 6-band parts — the temperature coefficient in ppm/K. The encode endpoint goes the other way: give it a resistance in ohms (and optionally a band count and tolerance) and it returns the colour bands, picking the nearest value representable with the available significant digits. The eseries endpoint snaps any value to the nearest preferred resistor value in the E6, E12, E24, E48 or E96 series and reports the percentage error and the neighbouring preferred values. It uses the standard IEC 60062 colour assignments. Everything is computed locally and deterministically, so it is instant and private. Ideal for electronics design, PCB and BOM work, lab and hobby bench use, repair, and teaching. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 4 endpoints. This is for resistors; for general number formatting use a number-format API."},"meta":{"timestamp":"2026-06-03T17:42:16.673Z","request_id":"b2368b02-1939-40c5-babe-5f16e566dadd"},"status":"ok","message":"Meta","success":true}}}},"401":{"description":"Missing or invalid x-oanor-key header"},"402":{"description":"Active subscription required"},"429":{"description":"Rate-limit or monthly quota reached"},"502":{"description":"Upstream did not respond"}}}}},"x-oanor-pricing":[{"slug":"free","name":"Free","price_cents_month":0,"monthly_call_quota":5735,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":725,"monthly_call_quota":15250,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2715,"monthly_call_quota":203500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6515,"monthly_call_quota":1060000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/resistor-api"}