# Fetting data from builder

**URL:** <https://forum.builder.io/t/fetting-data-from-builder/6923>\
**Category:** General\
**Tags:** nextjs\
**Created:** [December 9, 2024, 3:37pm UTC](https://forum.builder.io/t/fetting-data-from-builder/6923 "2024-12-09T15:37:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![aregkruitbosch](https://avatars.discourse-cdn.com/v4/letter/a/e79b87/32.png) [@aregkruitbosch](https://forum.builder.io/u/aregkruitbosch)\
**Post date:** [December 9, 2024, 3:37pm UTC](https://forum.builder.io/t/fetting-data-from-builder/6923/1 "2024-12-09T15:37:44Z")

</div>

Hello team,  
could you tell me please what is the best way to get data from builder,  
do i always need to fetch builder to get specific data or there is built in hook or something for easy usage ?

---

<div class="post-metadata">

**Author:** ![manish-sharma](https://avatars.discourse-cdn.com/v4/letter/m/8797f3/32.png) [@manish-sharma](https://forum.builder.io/u/manish-sharma)\
**Post date:** [December 9, 2024, 4:35pm UTC](https://forum.builder.io/t/fetting-data-from-builder/6923/2 "2024-12-09T16:35:01Z")

</div>

Hello @aregkruitbosch,

Welcome to the [Builder.io](http://Builder.io) forum!

You can use the [Content API](https://www.builder.io/c/docs/content-api) to query and retrieve data from your models in Builder. The API supports advanced query filtering, allowing you to fetch exactly the data you need.

Depending on the Builder SDK you are using ([React Gen 1 or Gen 2](https://www.builder.io/c/docs/sdk-comparison)), here are examples to help you get started:

### **For Gen 1**

Import `builder` and use the `get()` or `getAll()` helper:

```auto
import { builder } from '@builder.io/react';

const page = await builder.get('page', {
  fields: 'data.url, name',
});

const pages = await builder.getAll('page', {
  fields: 'data.url,name',
});

```

### **For Gen 2**

Import `fetchOneEntry()` and `fetchEntries()` to fetch single and multiple entries, respectively. Note that the `apiKey` is a required field:

```auto
import { fetchOneEntry, fetchEntries } from '@builder.io/sdk-react';

const page = await fetchOneEntry({
  model: 'page',
  fields: 'data.url,name',
  apiKey: 'YOUR_API_KEY'
});

const pages = await fetchEntries({
  model: 'page',
  fields: 'data.url,name',
  apiKey: 'YOUR_API_KEY',});

```

For reference and example code for other SDK, you can refer to the below links.

> **[SDK Comparison](https://www.builder.io/c/docs/sdk-comparison)**
>
> Covers the differences between the Gen 1 and Gen 2 Builder Javascript framework SDKs. Includes package references, helpers, and fetching references and Symbols.

> **[Integrate Structured Data](https://www.builder.io/c/docs/integrate-cms-data)**
>
> Builder is an AI-Powered Visual Development Platform that helps teams generate, iterate, and optimize web and mobile experiences in seconds instead of sprints.

> **[Content API](https://www.builder.io/c/docs/content-api)**
>
> Learn how to use Builder's Content API to make requests to retrieve data about any of your models. Write queries with dot notation and MongoDB style operators.

Hope it helps!

Thanks,
