Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unauthorized Error (403) when Using SERPER_API_KEY for Google Search #633

Closed
0x11c11e opened this issue May 17, 2024 · 7 comments
Closed

Comments

@0x11c11e
Copy link

Description:

Whenever the software attempts to search in Google using the SERPER_API_KEY, I encounter an unauthorized error despite the API key being set correctly.

Steps to Reproduce:

  1. Run the software with the correctly set SERPER_API_KEY.
  2. Trigger a Google search action, such as
Action: Search the internet
Action Input: {"search_query": "Predictions for used car market in 2024"}

Expected Result:

The software should perform the Google search and return the relevant results.

Actual Result:

The following error message is returned:

{'message': 'Unauthorized.', 'statusCode': 403}

Additional Context:

Log Output:

> Entering new CrewAgentExecutor chain...
To accomplish this task, the first thing I need to do is to gather data about the current trends in the used car market, factors that influence the prices, and any predictions available for 2024. This will allow me to make an educated guess about whether the prices of used cars will go up or down in 2024.

Action: Search the internet
Action Input: {"search_query": "Predictions for used car market in 2024"} 

{'message': 'Unauthorized.', 'statusCode': 403}

Environment:

Software Version:

  • crewai 0.28.8
  • crewai-tools 0.1.6
  • Python 3.12.3
  • pip 24.0

Operating System: Windows
Additional Details: Jupyter

@gadgethome
Copy link

Please can you try with the latest version. I just tested it and worked ok

crewai 0.30.11
crewai-tools 0.2.6

@0x11c11e
Copy link
Author

I got the exact same issue with the latest versions.

pip install crewai==0.30.11 crewai_tools==0.2.6 langchain_community

@theCyberTech
Copy link
Contributor

What website is it trying to access

@wildcolor
Copy link

Are you using the local LLMs? I haven't got any success with any of the local LLMs with search tools...

@0x11c11e
Copy link
Author

What website is it trying to access

It is trying to use scaleserp.com to perform a search on google.

Are you using the local LLMs? I haven't got any success with any of the local LLMs with search tools...

No. It is openai api.

I have tested on both windows and Linux, in jupyter and out of it, but the same issue.

@michaelc2005
Copy link

Newbie here, but I had a similar issue. It was very, very frustrating... I had gotten an API key from scaleserp.com, but I finally figured out what was actually required was an API key from serper.dev. Now all of those SerperDevTool searches are working for me.

@mintymac
Copy link

mintymac commented Jun 6, 2024

@michaelc2005 I did exactly the same thing and was driving myself nuts. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants