Can't get API to work

Hello! Working on a little project, was hoping someone could help me out. I’ve been banging my head against the wall for days trying to get this fetch request to an API to work. The API is EmailRep at Introduction - Introduction. I keep getting 403 responses and I’m assuming it has to do with credentials. I’ve tried putting them in a header and everywhere else but I keep getting “failed to fetch” or 403 errors. Any help would really be appreciated. Thanks!

 const submitHandler = (e) => {
    if (!validator.isEmail(emailToCheck)) {
      alert("Enter valid email!");
    } else {
          method  : 'GET',
          headers: {
            "User-Agent": "RKD412",
        (result) => {

        (error) => {

I think the reason is that you’re using the demo app for cors-anywhere (, although it could be something to do with checking at the originating server end (it might not like the proxy). It’s severely rate-limited to ensure you can’t keep doing what you’re trying to do. It will allow a request through every so often. Most of the time,if you make repeated requests (normal when you’re seeing if something works), it won’t. If you want a CORs proxy, you could do worse than following the instructions he gives to deploy your own CORs proxy, or else find another service.

1 Like

Thank you for your response! Is a CORs proxy even something I need for this particular API? I just threw it on there as an attempt to see if the fetch would then work. When I remove it I know longer get the 403 response but simply a “TypeError: Failed to fetch”. I’ll try to see about deploying my own CORs proxy as well. Not sure why this API is giving me so much trouble, it seemed much simpler than the other ones I have been messing around with this week.

This would indicate something else: I can’t see anything immediately wrong in the code, when you try it what does the information on the network tab in your browser tools say?

1 Like

Thanks again for the help! I’ll copy what was in the Network tab below in the Headers section. The response section simply says “Failed to load response data: no data found for resource with given identifier.”

1. Request URL:

2. Request Method:

3. Status Code:

4. Referrer Policy:

1. Response HeadersView source

1. Connection:

2. Content-Encoding:

3. Content-Type:

4. Date:
Mon, 25 Oct 2021 19:49:48 GMT

5. ETag:

6. Last-Modified:
Mon, 12 Oct 2020 17:13:18 GMT

7. Server:
nginx/1.10.3 (Ubuntu)

8. Transfer-Encoding:

2. Request HeadersView source

1. Accept:

 2. Accept-Encoding:
gzip, deflate, br

3. Accept-Language:

4. Connection:

5. Host:

6. Origin:

7. Referer:

8. sec-ch-ua:
"Chromium";v="95", ";Not A Brand";v="99"

9. sec-ch-ua-mobile:

10. sec-ch-ua-platform:

11. Sec-Fetch-Dest:

12. Sec-Fetch-Mode:

13. Sec-Fetch-Site:

You can test the endpoint in their docs, here: Query an email - /{email} - Reference - Technical Reference - Introduction

When you toggle on the Send requests directly from the browser (CORS must be enabled) option under Test Request and make a request directly from the browser it will get blocked due to CORS settings.

If you check the failed response message it is : “Failed to load response data: no data found for resource with given identifier.”

You could try to set up your own CORS proxy as Dan mentioned in this comment.

1 Like

Awesome, thank you both for your responses! It really helped me out a lot.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.