Fetch API

The Fetch API provides an interface for fetching resources (including across the network). It is a more powerful and flexible replacement for XMLHttpRequest.

Concepts and usage

The Fetch API uses Request and Response objects (and other things involved with network requests), as well as related concepts such as CORS and the HTTP Origin header semantics.

For making a request and fetching a resource, use the fetch() method. It is a global method in both Window and Worker contexts. This makes it available in pretty much any context you might want to fetch resources in.

The fetch() method takes one mandatory argument, the path to the resource you want to fetch. It returns a Promise that resolves to the Response to that request — as soon as the server responds with headers — even if the server response is an HTTP error status. You can also optionally pass in an init options object as the second argument (see Request).

Once a Response is retrieved, there are a number of methods available to define what the body content is and how it should be handled.

You can create a request and response directly using the Request() and Response() constructors, but it's uncommon to do this directly. Instead, these are more likely to be created as results of other API actions (for example, FetchEvent.respondWith() from service workers).

Find out more about using the Fetch API features in Using Fetch.

Deferred Fetch

The fetchLater() API enables a developer to request a deferred fetch, that can be sent after a specified period of time, or when the page is closed or navigated away from. See Using Deferred Fetch.

Interfaces

Window.fetch() and WorkerGlobalScope.fetch()

The fetch() method used to fetch a resource.

Window.fetchLater()

Used to make a deferred fetch request.

DeferredRequestInit

Represents the set of options that can be used to configure a deferred fetch request.

FetchLaterResult

Represents the result of requesting a deferred fetch.

Headers

Represents response/request headers, allowing you to query them and take different actions depending on the results.

Request

Represents a resource request.

Response

Represents the response to a request.

HTTP headers

deferred-fetch

Controls the top-level quota for the fetchLater() API.

deferred-fetch-minimal

Controls the shared cross-origin subframe quota for the fetchLater() API.

Specifications

Specification
Fetch
# fetch-method
Fetch
# deferred-fetch

Browser compatibility

api.fetch

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Bun
Deno
Node.js
fetch
Chrome – Full support
Chrome 42 (Release date: 2015-04-14)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 39 (Release date: 2015-07-02)
footnote Full support
Opera – Full support
Opera 29 (Release date: 2015-04-28)
footnote Full support
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 42 (Release date: 2015-04-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 39 (Release date: 2015-07-02)
footnote Full support
Opera Android – Full support
Opera Android 29 (Release date: 2015-04-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 42 (Release date: 2015-04-15)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote
footnote Fetching with a "manual" redirect mode does not result in a "opaqueredirect" response, but a regular response.
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote Full support
Authorization header removed from cross-origin redirects
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Full support
Firefox 111 (Release date: 2023-03-14)
footnote Full support
Opera – No support
Opera
footnote No support
Safari – Full support
Safari 16.1 (Release date: 2022-10-24)
footnote Full support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Full support
Firefox for Android 111 (Release date: 2023-03-14)
footnote Full support
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – Full support
Safari on iOS 16.1 (Release date: 2022-10-24)
footnote Full support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – Full support
WebView on iOS 16.1 (Release date: 2022-10-24)
footnote Full support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support
Support for blob: and data:
Chrome – Full support
Chrome 48 (Release date: 2016-01-20)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 39 (Release date: 2015-07-02)
footnote Full support
Opera – Full support
Opera 35 (Release date: 2016-02-02)
footnote Full support
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 48 (Release date: 2016-01-26)
footnote Full support
Firefox for Android – Full support
Firefox for Android 39 (Release date: 2015-07-02)
footnote Full support
Opera Android – Full support
Opera Android 35 (Release date: 2016-02-04)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 5 (Release date: 2016-12-15)
footnote Full support
WebView Android – Full support
WebView Android 43 (Release date: 2015-05-27)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Bun – No support
Bun
footnote No support
Deno – Full support
Deno 1.9 (Release date: 2021-04-13)
footnote Full support
Node.js – No support
Node.js
footnote No support
options parameter
Chrome – Full support
Chrome 42 (Release date: 2015-04-14)
footnote
footnote From Chrome 47, default values for the properties changed. mode defaults to same-origin (from no-cors). credentials defaults to include (from same-origin). redirect defaults to follow (from manual).
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 39 (Release date: 2015-07-02)
footnote Full support
Opera – Full support
Opera 29 (Release date: 2015-04-28)
footnote
footnote From Opera 34, default values for the properties changed. mode defaults to same-origin (from no-cors). credentials defaults to include (from same-origin). redirect defaults to follow (from manual).
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 42 (Release date: 2015-04-15)
footnote
footnote From Chrome Android 47, default values for the properties changed. mode defaults to same-origin (from no-cors). credentials defaults to include (from same-origin). redirect defaults to follow (from manual).
Firefox for Android – Full support
Firefox for Android 39 (Release date: 2015-07-02)
footnote Full support
Opera Android – Full support
Opera Android 29 (Release date: 2015-04-28)
footnote
footnote From Opera Android 34, default values for the properties changed. mode defaults to same-origin (from no-cors). credentials defaults to include (from same-origin). redirect defaults to follow (from manual).
Safari on iOS – Full support
Safari on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote
footnote From Samsung Internet 5.0, default values for the properties changed. mode defaults to same-origin (from no-cors). credentials defaults to include (from same-origin). redirect defaults to follow (from manual).
WebView Android – Full support
WebView Android 42 (Release date: 2015-04-15)
footnote
footnote From WebView Android 47, default values for the properties changed. mode defaults to same-origin (from no-cors). credentials defaults to include (from same-origin). redirect defaults to follow (from manual).
WebView on iOS – Full support
WebView on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote
footnote Fetching with a "manual" redirect mode does not result in a "opaqueredirect" response, but a regular response.
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote Full support
attributionReporting property
Deprecated
Chrome – Full support
Chrome 125 (Release date: 2024-05-14)
footnote Full support
Edge – Full support
Edge 125 (Release date: 2024-05-17)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 111 (Release date: 2024-06-12)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 125 (Release date: 2024-05-14)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 83 (Release date: 2024-06-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 27 (Release date: 2024-11-06)
footnote Full support
WebView Android – Full support
WebView Android 125 (Release date: 2024-05-14)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support
body property
Chrome – Full support
Chrome 42 (Release date: 2015-04-14)
footnote Full support
Edge – Full support
Edge 14 (Release date: 2016-08-02)
footnote Full support
Firefox – Full support
Firefox 39 (Release date: 2015-07-02)
footnote Full support
Opera – Full support
Opera 29 (Release date: 2015-04-28)
footnote Full support
Safari – Full support
Safari 10.1 (Release date: 2017-03-27)
footnote Full support
Chrome Android – Full support
Chrome Android 42 (Release date: 2015-04-15)
footnote Full support
Firefox for Android – Full support
Firefox for Android 39 (Release date: 2015-07-02)
footnote Full support
Opera Android – Full support
Opera Android 29 (Release date: 2015-04-28)
footnote Full support
Safari on iOS – Full support
Safari on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Samsung Internet – Full support
Samsung Internet 4 (Release date: 2016-03-11)
footnote Full support
WebView Android – Full support
WebView Android 42 (Release date: 2015-04-15)
footnote Full support
WebView on iOS – Full support
WebView on iOS 10.3 (Release date: 2017-03-27)
footnote Full support
Bun – Full support
Bun 1 (Release date: 2023-09-08)
footnote Full support
Deno – Full support
Deno 1 (Release date: 2020-05-13)
footnote Full support
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote Full support
ReadableStream body
Experimental
Chrome – Full support
Chrome 105 (Release date: 2022-09-02)
footnote Full support
Edge – Full support
Edge 105 (Release date: 2022-09-01)
footnote Full support
Firefox – No support
Firefox
footnote
footnote See bug 1387483
Opera – Full support
Opera 91 (Release date: 2022-09-14)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 105 (Release date: 2022-09-02)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1387483
Opera Android – Full support
Opera Android 72 (Release date: 2022-10-21)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 20 (Release date: 2023-02-10)
footnote Full support
WebView Android – Full support
WebView Android 105 (Release date: 2022-09-02)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
Bun – No support
Bun
footnote No support
Deno – Full support
Deno 1.7 (Release date: 2021-01-19)
footnote Full support
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote Full support
browsingTopics property
Deprecated Non-standard
Chrome – Full support
Chrome 126 (Release date: 2024-06-11)
footnote Full support
Edge – Full support
Edge 126 (Release date: 2024-06-13)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 112 (Release date: 2024-07-11)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 126 (Release date: 2024-06-11)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 83 (Release date: 2024-06-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 28 (Release date: 2025-04-02)
footnote Full support
WebView Android – Full support
WebView Android 126 (Release date: 2024-06-11)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support
duplex property
Experimental
Chrome – Full support
Chrome 105 (Release date: 2022-09-02)
footnote Full support
Edge – Full support
Edge 105 (Release date: 2022-09-01)
footnote Full support
Firefox – No support
Firefox
footnote
footnote See bug 1792434
Opera – Full support
Opera 91 (Release date: 2022-09-14)
footnote Full support
Safari – No support
Safari
footnote
footnote See bug 245671
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1792434
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote
footnote See bug 245671
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote
footnote See bug 245671
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js 18.13 – 18.20 (Release date: 2023-01-06)
footnote Removed in 19 and later
Node.js – Full support
Node.js 19.1 (Release date: 2022-11-14)
footnote Full support
keepalive property
Chrome – Full support
Chrome 66 (Release date: 2018-04-17)
footnote Full support
Edge – Full support
Edge 15 (Release date: 2017-04-05)
footnote Full support
Firefox – Full support
Firefox 133 (Release date: 2024-11-26)
footnote Full support
Opera – Full support
Opera 53 (Release date: 2018-05-10)
footnote Full support
Safari – Full support
Safari 13 (Release date: 2019-09-19)
footnote Full support
Chrome Android – Full support
Chrome Android 66 (Release date: 2018-04-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 133 (Release date: 2024-11-26)
footnote Full support
Opera Android – Full support
Opera Android 47 (Release date: 2018-07-23)
footnote Full support
Safari on iOS – Full support
Safari on iOS 13 (Release date: 2019-09-19)
footnote Full support
Samsung Internet – Full support
Samsung Internet 9 (Release date: 2018-09-15)
footnote Full support
WebView Android – Full support
WebView Android 66 (Release date: 2018-04-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 13 (Release date: 2019-09-19)
footnote Full support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote Full support
priority property
Chrome – Full support
Chrome 101 (Release date: 2022-04-26)
footnote Full support
Edge – Full support
Edge 101 (Release date: 2022-04-28)
footnote Full support
Firefox – Full support
Firefox 132 (Release date: 2024-10-29)
footnote Full support
Opera – Full support
Opera 87 (Release date: 2022-05-17)
footnote Full support
Safari – Full support
Safari 17.2 (Release date: 2023-12-11)
footnote Full support
Chrome Android – Full support
Chrome Android 101 (Release date: 2022-04-26)
footnote Full support
Firefox for Android – Full support
Firefox for Android 132 (Release date: 2024-10-29)
footnote Full support
Opera Android – Full support
Opera Android 70 (Release date: 2022-06-29)
footnote Full support
Safari on iOS – Full support
Safari on iOS 17.2 (Release date: 2023-12-11)
footnote Full support
Samsung Internet – Full support
Samsung Internet 19 (Release date: 2022-11-01)
footnote Full support
WebView Android – Full support
WebView Android 101 (Release date: 2022-04-26)
footnote Full support
WebView on iOS – Full support
WebView on iOS 17.2 (Release date: 2023-12-11)
footnote Full support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support
privateToken property
Experimental
Chrome – Full support
Chrome 117 (Release date: 2023-09-12)
footnote Full support
Edge – Full support
Edge 117 (Release date: 2023-09-15)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 103 (Release date: 2023-10-03)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 117 (Release date: 2023-09-12)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 78 (Release date: 2023-10-23)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 24 (Release date: 2024-01-25)
footnote Full support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support
referrerPolicy property
Chrome – Full support
Chrome 52 (Release date: 2016-07-20)
footnote Full support
Edge – Full support
Edge 79 (Release date: 2020-01-15)
footnote Full support
Firefox – Full support
Firefox 52 (Release date: 2017-03-07)
footnote Full support
Opera – Full support
Opera 39 (Release date: 2016-08-02)
footnote Full support
Safari – Full support
Safari 11.1 (Release date: 2018-04-12)
footnote Full support
Chrome Android – Full support
Chrome Android 52 (Release date: 2016-07-27)
footnote Full support
Firefox for Android – Full support
Firefox for Android 52 (Release date: 2017-03-07)
footnote Full support
Opera Android – Full support
Opera Android 41 (Release date: 2016-10-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – Full support
Samsung Internet 6 (Release date: 2017-08-23)
footnote Full support
WebView Android – Full support
WebView Android 52 (Release date: 2016-07-27)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote No support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support
signal property
Chrome – Full support
Chrome 66 (Release date: 2018-04-17)
footnote Full support
Edge – Full support
Edge 16 (Release date: 2017-10-17)
footnote Full support
Firefox – Full support
Firefox 57 (Release date: 2017-11-14)
footnote Full support
Opera – Full support
Opera 53 (Release date: 2018-05-10)
footnote Full support
Safari – Full support
Safari 11.1 (Release date: 2018-04-12)
footnote Full support
Chrome Android – Full support
Chrome Android 66 (Release date: 2018-04-17)
footnote Full support
Firefox for Android – Full support
Firefox for Android 57 (Release date: 2017-11-28)
footnote Full support
Opera Android – Full support
Opera Android 47 (Release date: 2018-07-23)
footnote Full support
Safari on iOS – Full support
Safari on iOS 11.3 (Release date: 2018-03-29)
footnote Full support
Samsung Internet – Full support
Samsung Internet 9 (Release date: 2018-09-15)
footnote Full support
WebView Android – Full support
WebView Android 66 (Release date: 2018-04-17)
footnote Full support
WebView on iOS – Full support
WebView on iOS 11.3 (Release date: 2018-03-29)
footnote Full support
Bun – No support
Bun
footnote No support
Deno – Full support
Deno 1.11 (Release date: 2021-06-08)
footnote Full support
Node.js – Full support
Node.js 18 (Release date: 2022-04-19)
footnote Full support
targetAddressSpace property
Experimental
Chrome – Full support
Chrome 142 (Release date: 2025-10-28)
footnote Full support
Edge – Full support
Edge 142 (Release date: 2025-10-31)
footnote Full support
Firefox – No support
Firefox
footnote No support
Opera – Full support
Opera 126 (Release date: 2026-01-08)
footnote Full support
Safari – No support
Safari
footnote No support
Chrome Android – Full support
Chrome Android 142 (Release date: 2025-10-28)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote No support
Opera Android – Full support
Opera Android 93 (Release date: 2025-11-25)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support
Bun – No support
Bun
footnote No support
Deno – No support
Deno
footnote No support
Node.js – No support
Node.js
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
Non-standard. Check cross-browser support before using.
Deprecated. Not for use in new websites.
See implementation notes.
Has more compatibility info.

api.Window.fetchLater

desktop mobile server
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Deno
fetchLater
Experimental
Chrome – Full support
Chrome 135 (Release date: 2025-04-01)
footnote Full support
Edge – Full support
Edge 135 (Release date: 2025-04-04)
footnote Full support
Firefox – No support
Firefox
footnote
footnote See bug 1936180
Opera – Full support
Opera 120 (Release date: 2025-07-02)
footnote Full support
Safari – No support
Safari
footnote
footnote See bug 284347
Chrome Android – Full support
Chrome Android 135 (Release date: 2025-04-01)
footnote Full support
Firefox for Android – No support
Firefox for Android
footnote
footnote See bug 1936180
Opera Android – Full support
Opera Android 89 (Release date: 2025-04-29)
footnote Full support
Safari on iOS – No support
Safari on iOS
footnote
footnote See bug 284347
Samsung Internet – Full support
Samsung Internet 29 (Release date: 2025-10-25)
footnote Full support
WebView Android – Full support
WebView Android 135 (Release date: 2025-04-01)
footnote Full support
WebView on iOS – No support
WebView on iOS
footnote
footnote See bug 284347
Deno – No support
Deno
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
No support
No support
Experimental. Expect behavior to change in the future.
See implementation notes.

See also