Skip to main content

[ ![Redux Logo](/img/redux.svg) ![Redux Logo](/img/redux.svg) **Redux
Toolkit** ](/)

[ Getting Started ](/introduction/getting-started) [ Tutorials
](/tutorials/overview) [ Usage Guide ](/usage/usage-guide) [ API
](/api/configureStore) [ RTK Query ](/rtk-query/overview) [ GitHub
](https://github.com/reduxjs/redux-toolkit)

Search

  * [ Introduction ](/introduction/getting-started)

    * [ Getting Started ](/introduction/getting-started)
    * [ Why Redux Toolkit is How To Use Redux Today ](/introduction/why-rtk-is-redux-today)
  * [ Tutorials ](/tutorials/overview)

    * [ Tutorials Overview ](/tutorials/overview)
    * [ Quick Start ](/tutorials/quick-start)
    * [ TypeScript Quick Start ](/tutorials/typescript)
    * [ RTK Query Quick Start ](/tutorials/rtk-query)
  * [ Using Redux Toolkit ](/usage/migrating-to-modern-redux)

    * [ Migrations ](/usage/migrating-to-modern-redux)

    * [ Usage Guide ](/usage/usage-guide)
    * [ Usage With TypeScript ](/usage/usage-with-typescript)
    * [ Writing Reducers with Immer ](/usage/immer-reducers)
    * [ Setup with Next.js ](/usage/nextjs)
  * [ API Reference ](/api/configureStore)

  * [ RTK Query ](/rtk-query/overview)

    * [ RTK Query Overview ](/rtk-query/overview)
    * [ Comparison with Other Tools ](/rtk-query/comparison)
    * [ Examples ](/rtk-query/usage/examples)
    * [ Usage With TypeScript ](/rtk-query/usage-with-typescript)
    * [ Using RTK Query ](/rtk-query/usage/queries)

    * [ API Reference ](/rtk-query/api/createApi)

  * [ ](/)
  * RTK Query 
  * RTK Query Overview 

On this page

#  RTK Query Overview

What You'll Learn

  * What RTK Query is and what problems it solves 
  * What APIs are included in RTK Query 
  * Basic RTK Query usage 

**RTK Query** is a powerful data fetching and caching tool. It is designed to
simplify common cases for loading data in a web application, **eliminating the
need to hand-write data fetching & caching logic yourself ** .

RTK Query is **an optional addon included in the Redux Toolkit package** , and
its functionality is built on top of the other APIs in Redux Toolkit.

info

To learn how to use RTK Query, see the full [ "Redux Essentials" tutorial
](https://redux.js.org/tutorials/essentials/part-7-rtk-query-basics) on the
Redux core docs site.

If you prefer a video course, you can [ watch this RTK Query video course by
Lenz Weber-Tronic, the creator of RTK Query, for free at Egghead
](https://egghead.io/courses/rtk-query-basics-query-endpoints-data-flow-and-
typescript-57ea3c43?af=7pnhj6) or take a look at the first lesson right here:

##  Motivation  ​

Web applications normally need to fetch data from a server in order to display
it. They also usually need to make updates to that data, send those updates to
the server, and keep the cached data on the client in sync with the data on
the server. This is made more complicated by the need to implement other
behaviors used in today's applications:

  * Tracking loading state in order to show UI spinners 
  * Avoiding duplicate requests for the same data 
  * Optimistic updates to make the UI feel faster 
  * Managing cache lifetimes as the user interacts with the UI 

The Redux core has always been very minimal - it's up to developers to write
all the actual logic. That means that Redux has never included anything built
in to help solve these use cases. The Redux docs have taught [ some common
patterns for dispatching actions around the request lifecycle to track loading
state and request results
](https://redux.js.org/tutorials/fundamentals/part-7-standard-patterns#async-
request-status) , and [ Redux Toolkit's ` createAsyncThunk ` API
](/api/createAsyncThunk) was designed to abstract that typical pattern.
However, users still have to write significant amounts of reducer logic to
manage the loading state and the cached data.

Over the last couple years, the React community has come to realize that
**"data fetching and caching" is really a diff