Skip to content

Data Fetching

Source URL: https://nextjs.org/docs/pages/building-your-application/data-fetching

Data fetching in Next.js allows you to render your content in different ways, depending on your application’s use case. These include pre-rendering with Server-side Rendering or Static Generation, and updating or creating content at runtime with Incremental Static Regeneration.

  • getStaticProps
    • Fetch data and generate static pages with getStaticProps. Learn more about this API for data fetching in Next.js.
  • getStaticPaths
    • Fetch data and generate static pages with getStaticPaths. Learn more about this API for data fetching in Next.js.
  • Forms and Mutations
    • Learn how to handle form submissions and data mutations with Next.js.
  • getServerSideProps
    • Fetch data on each request with getServerSideProps.
  • Client-side Fetching
    • Learn about client-side data fetching, and how to use SWR, a data fetching React Hook library that handles caching, revalidation, focus tracking, refetching on interval and more.