LuanRT / google-this

A simple yet powerful module to retrieve organic search results and much more from Google.

Home Page:https://www.npmjs.com/package/googlethis

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

I am getting a CORS issue

SeniorEng opened this issue · comments

Question

Access to XMLHttpRequest at 'https://google.com/search?q=ewwefwe&ie=UTF-8&aomd=1&start=0&hl=en' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I am trying to use this GoogleThis API in React App.
Here is my codebase.

const options: object = {
    page: 0,
    safe: false,
    parse_ads: false,
    additional_params: {
      hl: "en",
    },
  };

const response = await google.search(searchString, options);

But currently I am getting a CORS issue, and I am not sure how to resolve this issue.

Could you please help me to solve this problem?

Thank you

Other details

No response

Checklist

  • I am running the latest version.
  • I checked the documentation and found no answer.
  • I have searched the existing issues and made sure this is not a duplicate.
  • I have provided sufficient information.
commented

You'll have to setup a cors proxy for that.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Could you give detailed instructions on how to configure this proxy in your package?