{"openapi":"3.1.0","info":{"title":"Dotenv API","version":"1.0.0","description":"Convert between .env (dotenv) files and JSON, in both directions. The parse endpoint reads .env text into a clean JSON object: it skips blank lines and # comments, honours an optional leading export, unquotes single- and double-quoted values (interpreting \\n, \\t and \\\" escapes inside double quotes), strips inline comments after unquoted values, supports values that span several lines inside quotes, and can optionally expand ${VAR} and $VAR references against the variables already defined earlier in the same file — while leaving single-quoted values strictly literal. The stringify endpoint turns a JSON object back into a valid .env file, quoting only the values that actually need it and optionally prefixing every line with export for shell sourcing. Everything is computed locally and deterministically, so it is instant and private — your secrets never leave the request. Ideal for config tooling and migrations, CI/CD pipelines, converting .env to JSON for apps that want structured config (and back), and validating environment files. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This handles the dotenv format; for INI files with [sections] use an INI API, and for YAML or TOML use those APIs.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/dotenv-api","description":"oanor gateway"}],"tags":[{"name":"Dotenv"},{"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/parse":{"get":{"operationId":"get_v1_parse","tags":["Dotenv"],"summary":"Parse a .env file","description":"","parameters":[{"name":"env","in":"query","required":true,"description":"The .env file text","schema":{"type":"string"},"example":"FOO=bar\nexport BAZ=\"hello world\""},{"name":"expand","in":"query","required":false,"description":"Expand ${VAR}/$VAR references (default false)","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"count":2,"parsed":{"BAZ":"hello world","FOO":"bar"},"expanded":false},"meta":{"timestamp":"2026-06-03T17:42:21.771Z","request_id":"ce5aa50c-af0c-4c00-bf8a-92f1ee1b069d"},"status":"ok","message":"Parse a .env file","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/stringify":{"get":{"operationId":"get_v1_stringify","tags":["Dotenv"],"summary":"Build a .env file","description":"","parameters":[{"name":"json","in":"query","required":true,"description":"An object (JSON) to serialize","schema":{"type":"string"},"example":"{\"HOST\":\"localhost\",\"PORT\":\"5432\"}"},{"name":"export","in":"query","required":false,"description":"true to prefix each line with export","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"env":"HOST=localhost\nPORT=5432","count":2},"meta":{"timestamp":"2026-06-03T17:42:21.879Z","request_id":"9b7099a8-43fc-4ea1-ba96-044b34ba915d"},"status":"ok","message":"Build a .env file","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":"Dotenv API","notes":"Single-quoted values are literal (never expanded); double-quoted values interpret escapes and may be expanded. This handles the dotenv format — for INI files with [sections] use an INI API, and for YAML/TOML use those APIs. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/parse","params":{"env":"the .env file text (required)","expand":"expand ${VAR}/$VAR references (default false)"},"returns":"the parsed key/value object"},{"path":"/v1/stringify","params":{"json":"an object (JSON) to serialize (required)","export":"true to prefix each line with export"},"returns":"the .env file text"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Convert between .env (dotenv) files and JSON, both ways. The parse endpoint reads .env text into a clean JSON object — skipping blank lines and # comments, honouring an optional leading export, unquoting single- and double-quoted values (with \\n, \\t and \\\" escapes inside double quotes), stripping inline comments after unquoted values, supporting values that span multiple lines inside quotes, and optionally expanding ${VAR} / $VAR references against earlier variables in the same file. The stringify endpoint turns a JSON object back into a valid .env file, quoting only the values that need it and optionally prefixing each line with export. Pure local, no key."},"meta":{"timestamp":"2026-06-03T17:42:21.973Z","request_id":"1a39317e-69ec-4e45-bdbc-b3bbbb1bd5a2"},"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":4235,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":575,"monthly_call_quota":13750,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2565,"monthly_call_quota":188500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6365,"monthly_call_quota":985000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/dotenv-api"}