{"openapi":"3.1.0","info":{"title":"Cookie API","version":"1.0.0","description":"Parse and build HTTP cookies. The parse endpoint reads a Set-Cookie header into its name, value and structured attributes — Domain, Path, Expires, Max-Age, Secure, HttpOnly, SameSite, Priority and Partitioned — or, with mode=cookie, splits a request Cookie header like \"a=1; b=2; c=3\" into an ordered list and a name→value map. The serialize endpoint builds a correct Set-Cookie string from simple fields, with sensible defaults (Path=/), proper date formatting for Expires, optional URL-encoding of the value, and validation of the cookie name, the date and the enum attributes — and it automatically adds Secure when SameSite=None, as browsers require. Everything is computed locally and deterministically, so it is instant and private. Ideal for web frameworks and middleware, API debugging and proxies, session and consent tooling, testing and security review. Pure local computation — no key, no third-party service, instant. Live, nothing stored. 3 endpoints. This parses and builds cookie strings; it does not fetch a URL — to inspect a live site's response headers use a security-headers or HTTP API.","contact":{"name":"PremiumApi","url":"https://www.oanor.com/by/premiumapi"}},"servers":[{"url":"https://api.oanor.com/cookie-api","description":"oanor gateway"}],"tags":[{"name":"Cookie"},{"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":["Cookie"],"summary":"Parse a cookie","description":"","parameters":[{"name":"cookie","in":"query","required":true,"description":"The Set-Cookie string (or a Cookie header)","schema":{"type":"string"},"example":"sid=abc; Path=/; Secure; HttpOnly; SameSite=Lax"},{"name":"mode","in":"query","required":false,"description":"'set' (default) or 'cookie' for a request Cookie header","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"mode":"set","name":"sid","value":"abc","secure":true,"http_only":true,"same_site":"Lax","attributes":{"path":"/","secure":true,"httpOnly":true,"sameSite":"Lax"}},"meta":{"timestamp":"2026-06-03T09:25:04.586Z","request_id":"33d14055-80f2-4700-bb40-9157bcb95394"},"status":"ok","message":"Parse a cookie","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/serialize":{"get":{"operationId":"get_v1_serialize","tags":["Cookie"],"summary":"Build a Set-Cookie","description":"","parameters":[{"name":"name","in":"query","required":true,"description":"Cookie name","schema":{"type":"string"},"example":"sid"},{"name":"value","in":"query","required":false,"description":"Cookie value","schema":{"type":"string"},"example":"abc"},{"name":"domain","in":"query","required":false,"description":"Domain","schema":{"type":"string"}},{"name":"path","in":"query","required":false,"description":"Path (default /)","schema":{"type":"string"}},{"name":"max_age","in":"query","required":false,"description":"Max-Age in seconds","schema":{"type":"string"},"example":"3600"},{"name":"expires","in":"query","required":false,"description":"Expires date","schema":{"type":"string"}},{"name":"same_site","in":"query","required":false,"description":"Strict | Lax | None","schema":{"type":"string"},"example":"Lax"},{"name":"priority","in":"query","required":false,"description":"Low | Medium | High","schema":{"type":"string"}},{"name":"secure","in":"query","required":false,"description":"true to add Secure","schema":{"type":"string"}},{"name":"http_only","in":"query","required":false,"description":"true to add HttpOnly","schema":{"type":"string"}},{"name":"partitioned","in":"query","required":false,"description":"true to add Partitioned","schema":{"type":"string"}},{"name":"encode","in":"query","required":false,"description":"true to URL-encode the value","schema":{"type":"string"}}],"security":[{"oanorKey":[]}],"responses":{"200":{"description":"OK","content":{"application/json":{"example":{"data":{"name":"sid","value":"abc","set_cookie":"sid=abc; Path=/; Max-Age=3600; SameSite=Lax"},"meta":{"timestamp":"2026-06-03T09:25:04.665Z","request_id":"5122de44-639a-4023-80ba-6d183d6a1049"},"status":"ok","message":"Build a Set-Cookie","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":"Cookie API","notes":"Parsing is lenient (it does not reject malformed input); serializing validates the name, dates and enum attributes, and adds Secure automatically when SameSite=None. Nothing is stored.","version":"v1","endpoints":[{"path":"/v1/parse","params":{"mode":"'set' (default) for Set-Cookie, or 'cookie' for a request Cookie header","cookie":"the Set-Cookie string (or a Cookie header)"},"returns":"the parsed name, value and attributes (or the cookie list/map)"},{"path":"/v1/serialize","params":{"name":"cookie name (required)","path":"Path (default /)","value":"cookie value","domain":"Domain","encode":"true to URL-encode the value","secure":"true to add Secure","expires":"Expires date","max_age":"Max-Age in seconds","priority":"Low | Medium | High","http_only":"true to add HttpOnly","same_site":"Strict | Lax | None","partitioned":"true to add Partitioned"},"returns":"the Set-Cookie header string"},{"path":"/v1/meta","params":[],"returns":"this document"}],"description":"Parse and build HTTP cookies. The parse endpoint reads a Set-Cookie header into its name, value and structured attributes (Domain, Path, Expires, Max-Age, Secure, HttpOnly, SameSite, Priority, Partitioned) — or, with mode=cookie, splits a request Cookie header (a=1; b=2) into a list and a name→value map. The serialize endpoint builds a correct Set-Cookie string from simple fields, with sensible defaults (Path=/), date and value handling and validation. Pure local, no key."},"meta":{"timestamp":"2026-06-03T09:25:04.767Z","request_id":"cc504141-3dd9-40a9-a823-dbaa13d9690b"},"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":2235,"rps_limit":2,"hard_limit":true},{"slug":"starter","name":"Starter","price_cents_month":375,"monthly_call_quota":11750,"rps_limit":8,"hard_limit":true},{"slug":"pro","name":"Pro","price_cents_month":2365,"monthly_call_quota":168500,"rps_limit":20,"hard_limit":true},{"slug":"mega","name":"Mega","price_cents_month":6165,"monthly_call_quota":885000,"rps_limit":50,"hard_limit":true}],"x-oanor-marketplace-url":"https://www.oanor.com/api/cookie-api"}