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

Empty Response after few requests #158

Closed
mayukh4 opened this issue Mar 18, 2024 · 2 comments
Closed

Empty Response after few requests #158

mayukh4 opened this issue Mar 18, 2024 · 2 comments
Assignees
Labels
api Issues that correspond to arXiv API behavior rather than behavior introduced by this wrapper. bug Deviations from documented behavior. duplicate

Comments

@mayukh4
Copy link

mayukh4 commented Mar 18, 2024

`import arxiv

def fetch_astrophysics_papers(category, search_terms, num_papers=5, summarize=False):
keywords = [term.strip() for term in search_terms.split(',') if term.strip() != ''][:3] # Limit to 3 terms
query_parts = [f'(title:"{keyword}" OR abs:"{keyword}")' for keyword in keywords]
search_query = f'cat:astro-ph.{category} AND ({" OR ".join(query_parts)})'

# Fetch the papers from arXiv
search = arxiv.Search(
    query=search_query,
    max_results=min(num_papers, 50),  # Ensure num_papers does not exceed 50
    sort_by=arxiv.SortCriterion.SubmittedDate,
)'

So this is a part of a bigger code, essentially fetching arxiv papers. Recently, I have been facing an issue, where after running this code for 5-6 times I am getting empty responses. NOTE : at a time I am only fetching a maximum of 5 papers. The issue gets resolved after some time, or If I change my IP. It looks like I am reaching some kind of limit with just these limited requests. I don't know what I am doing wrong.

You should be able to reproduce this if you run it 5-6 times (let me know if you can).

@mayukh4 mayukh4 added the bug Deviations from documented behavior. label Mar 18, 2024
@lukasschwab lukasschwab added duplicate api Issues that correspond to arXiv API behavior rather than behavior introduced by this wrapper. labels Mar 18, 2024
@lukasschwab
Copy link
Owner

See #157, #129 — seems there's ongoing instability in the underlying API. This wrapper can't solve it.

@mayukh4
Copy link
Author

mayukh4 commented Mar 18, 2024

Yes, I did see some of the existing issues, but thought to ask out anyway! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api Issues that correspond to arXiv API behavior rather than behavior introduced by this wrapper. bug Deviations from documented behavior. duplicate
Projects
None yet
Development

No branches or pull requests

2 participants