{"schemaVersion":1,"id":"ofetch","name":"ofetch","locale":"en","canonicalUrl":"https://base.akulich.dev/en/library/ofetch/","officialUrl":"https://github.com/unjs/ofetch","isCatalog":false,"description":"A fetch client with parsing, errors, retries, and hooks: it helps align HTTP requests in browser and server applications.","tasks":["Align HTTP requests in browser and server code","Connect parsing, error handling, and required hooks or a retry policy"],"categoryIds":["backend"],"subcategoryIds":["backend.api"],"tags":["ofetch","API","Development"],"aliases":["unjs/ofetch","ofetch","unjs-ofetch"],"platforms":[],"stack":[],"compatibility":null,"pricing":"free","freeUsage":"Code and local use under MIT.","paidUsage":"Computing resources, self-hosting, and external services are paid for separately if used.","license":"MIT for the code; dependencies have separate licenses.","selectionGuide":{"purpose":"Align HTTP requests in browser and server code","chooseWhen":["Align HTTP requests in browser and server code","Connect parsing, error handling, and required hooks or a retry policy"],"considerInstead":[],"requirements":["Choose documentation for the installed version: HEAD is labeled v2 alpha; v1 has its own branch."],"limitations":["Costs and limits of free use: Computing resources, self-hosting, and external services are paid for separately if used.","Terms of use: MIT for the code; dependencies have separate licenses.","Retrying a modifying request may repeat the operation; align retry with server idempotency. ofetch.create defaults are copied only one level deep, so nested headers need attention."],"faq":[{"question":"What can you use for free in ofetch?","answer":"Code and local use under MIT."},{"question":"What additional costs might arise with ofetch?","answer":"Computing resources, self-hosting, and external services are paid for separately if used."},{"question":"What terms of use matter for ofetch?","answer":"MIT for the code; dependencies have separate licenses."},{"question":"How do you get started with ofetch?","answer":"Define the endpoint and expected external API response format. Connect parsing, error handling, and required hooks or a retry policy. Add error handling and an integration check of the result."},{"question":"Which HTTP requests does ofetch retry automatically?","answer":"ofetch parses responses, throws on response.ok=false, and provides error.data, timeout, and lifecycle hooks. By default it retries once for listed temporary HTTP errors but disables retries for POST/PUT/PATCH/DELETE. Explicit retry enables repeats for those methods too; timeout is disabled unless configured."}],"related":[],"sources":["https://github.com/unjs/ofetch","https://raw.githubusercontent.com/unjs/ofetch/HEAD/README.md","https://raw.githubusercontent.com/unjs/ofetch/HEAD/LICENSE","https://www.open-source-tools.com/","https://raw.githubusercontent.com/unjs/ofetch/v1/README.md"]},"selectionCheckedAt":null,"applicationGuide":{"goal":"Align HTTP requests in browser and server code.","inputs":["A data contract or HTTP workflow.","A project with a supported runtime."],"steps":["Define the endpoint and expected external API response format.","Connect parsing, error handling, and required hooks or a retry policy.","Add error handling and an integration check of the result."],"checks":["Invalid and missing data are handled predictably.","Types and the actual response agree; errors are not hidden."]},"sources":["https://github.com/unjs/ofetch","https://raw.githubusercontent.com/unjs/ofetch/HEAD/README.md","https://raw.githubusercontent.com/unjs/ofetch/HEAD/LICENSE","https://www.open-source-tools.com/","https://raw.githubusercontent.com/unjs/ofetch/v1/README.md"],"checkedAt":"2026-10-06","reviewScope":"The purpose, current repository license, and separate terms for code, services, and models have been reviewed. The product was not run, and no security audit was performed.","relatedIds":[],"dataVersion":"cbbe7123b47a5ae80983","type":"Backend / API library","kind":"library","pricingNote":"Code and local use under MIT. Computing resources, self-hosting, and external services are paid for separately if used.","notes":null,"labeledSources":[{"url":"https://github.com/unjs/ofetch","label":"Official source"},{"url":"https://raw.githubusercontent.com/unjs/ofetch/HEAD/README.md","label":"Official source"},{"url":"https://raw.githubusercontent.com/unjs/ofetch/HEAD/LICENSE","label":"License"},{"url":"https://www.open-source-tools.com/","label":"Catalog / discovery source"},{"url":"https://raw.githubusercontent.com/unjs/ofetch/v1/README.md","label":"Official source"}],"licenseGuides":[{"id":"mit","title":"MIT — permissive license","scope":null,"summary":"You can use, modify, distribute, and sell the code, including in a closed-source commercial product. When sharing copies or substantial portions of the code, retain the license text and copyright notice. You do not need to open-source your entire project; the author provides no warranties.","url":"https://opensource.org/license/mit"}],"entryIds":[],"composition":null}