Failed to fetch data from API: 400
cc-hh-ee-nn opened this issue · 2 comments
Research question: Omnichannel marketing
Auto Researcher initiated!
Generating keyword combinations...
Keyword combinations generated!
Fetching top 20 papers...
Exception Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_22004/801009983.py in
----> 1 researcher = literature_review(research_question)
~\anaconda3\envs\Python38\lib\site-packages\autoresearcher\workflows\literature_review\literature_review.py in literature_review(research_question, output_file)
73 search_query = research_question
74 print(colored("Fetching top 20 papers...", "yellow"))
---> 75 top_papers = SemanticScholar.fetch_and_sort_papers(search_query, keyword_combinations=keyword_combinations, year_range="2000-2023")
76 print(colored("Top 20 papers fetched!", "green"))
77
~\anaconda3\envs\Python38\lib\site-packages\autoresearcher\data_sources\web_apis\semantic_scholar_loader.py in fetch_and_sort_papers(self, search_query, limit, top_n, year_range, keyword_combinations, weight_similarity)
25
26 for combination in keyword_combinations:
---> 27 papers.extend(self.fetch_data(combination, limit, year_range))
28
29 max_citations = max(papers, key=lambda x: x['citationCount'])['citationCount']
~\anaconda3\envs\Python38\lib\site-packages\autoresearcher\data_sources\web_apis\semantic_scholar_loader.py in fetch_data(self, search_query, limit, year_range)
16 params["year"] = year_range
17
---> 18 data = self.make_request("", params=params)
19 return data.get('data', [])
20
~\anaconda3\envs\Python38\lib\site-packages\autoresearcher\data_sources\web_apis\base_web_api_data_loader.py in make_request(self, endpoint, params)
18 return data
19 else:
---> 20 raise Exception(f"Failed to fetch data from API: {response.status_code}")
21
Exception: Failed to fetch data from API: 400
Thanks for sharing this error you encountered. I'll have a look into it and will get back to you!
I can't reproduce this error, unfortunately. Did this occur repeatedly or just once?