tavily-ai / tavily-python

A python wrapper for Tavily search API
https://docs.tavily.com
MIT License
262 stars 42 forks source link

400 Client Error #15

Closed cqnimin closed 1 month ago

cqnimin commented 5 months ago

i apply a new key, add try to run the sample code, but it is always fail.

from tavily import TavilyClient tavily = TavilyClient(api_key="***")

For basic search:

response = tavily.search(query="Should I invest in Apple in 2024?")


HTTPError Traceback (most recent call last) in <cell line: 4>() 2 tavily = TavilyClient(api_key="tavily-cosQzSSIbve8T1DbjnmMY39vD0l3wXvQ") 3 # For basic search: ----> 4 response = tavily.search(query="Should I invest in Apple in 2024?")

2 frames /usr/local/lib/python3.10/dist-packages/requests/models.py in raise_for_status(self) 1019 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) 1022 1023 def close(self):

HTTPError: 400 Client Error: Bad Request for url: https://api.tavily.com/search

DrRaja commented 4 months ago

Same problem here. I was using the API and it used to give intermittent 502 errors, but since a couple of days all requests end with a 400 Client Error.

carl-vbn commented 3 months ago

Hello, Are you still experiencing the issue? If so, please regenerate your API key on the Tavily platform and try again. Also, be careful when posting error messages that you don't accidentally reveal your API key.

jobic10 commented 2 months ago

i apply a new key, add try to run the sample code, but it is always fail.

from tavily import TavilyClient tavily = TavilyClient(api_key="***")

For basic search:

response = tavily.search(query="Should I invest in Apple in 2024?")

HTTPError Traceback (most recent call last) in <cell line: 4>() 2 tavily = TavilyClient(api_key="tavily-cosQzSSIbve8T1DbjnmMY39vD0l3wXvQ") 3 # For basic search: ----> 4 response = tavily.search(query="Should I invest in Apple in 2024?")

2 frames /usr/local/lib/python3.10/dist-packages/requests/models.py in raise_for_status(self) 1019 1020 if http_error_msg: -> 1021 raise HTTPError(http_error_msg, response=self) 1022 1023 def close(self):

HTTPError: 400 Client Error: Bad Request for url: https://api.tavily.com/search

Avoid exposing your API keys