LuanRT / google-this

A simple yet powerful module to retrieve organic search results and much more from Google.
https://www.npmjs.com/package/googlethis
MIT License
320 stars 77 forks source link

I am getting a CORS issue #48

Closed SeniorEng closed 1 year ago

SeniorEng commented 1 year ago

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

LuanRT commented 1 year ago

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

github-actions[bot] commented 1 year ago

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.

hermesalvesbr commented 11 months ago

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