# Api CORS error in localhost

**URL:** <https://forum.builder.io/t/api-cors-error-in-localhost/4809>\
**Category:** FAQs\
**Created:** [January 17, 2024, 6:00pm UTC](https://forum.builder.io/t/api-cors-error-in-localhost/4809 "2024-01-17T18:00:02Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Luiz](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@Luiz](https://forum.builder.io/u/Luiz)\
**Post date:** [January 17, 2024, 6:00pm UTC](https://forum.builder.io/t/api-cors-error-in-localhost/4809/1 "2024-01-17T18:00:02Z")

</div>

I’m trying to make a request in the builder api content in localhost but I’m receiving CORS error. I’m using NextJs and the project is already setting apiKey.

example query:

const getArticles = async (name: string) =\> {  
try {  
const response = await builder.get(‘pible-page-article’, {  
query: {  
name: { $regex: `.*${name}.*`, $options: ‘i’ },  
},  
});

```
    return response.data.results;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
};

```

I already tried something like this

const getArticles = async (name: string) =\> {  
try {  
const response = await builder.get(‘pible-page-article’});

```
    return response;
  } catch (error) {
    console.error('Error:', error);
    throw error;
  }
};

```

---

<div class="post-metadata">

**Author:** ![anon43891756](https://avatars.discourse-cdn.com/v4/letter/a/50afbb/32.png) [@anon43891756](https://forum.builder.io/u/anon43891756)\
**Post date:** [January 25, 2024, 2:22pm UTC](https://forum.builder.io/t/api-cors-error-in-localhost/4809/2 "2024-01-25T14:22:02Z")

</div>

Hi @Luiz

- You can try to toggle Proxy Preview, Go to Account setting\>Organization\>Advanced Settings\>Select Advanced Tab\> toggle proxy previews on/off.
- You can also try to install our [Chrome Extension](https://www.builder.io/c/docs/guides/preview-url-working#using-the-builder-chrome-extension) to see if that helps.
