| 472 | |
| 473 | |
| 474 | def fetch_arxiv_entries(*, search_query: str = "", id_list: str = "", max_results: int = 10) -> list[dict[str, Any]]: |
| 475 | params = urllib.parse.urlencode( |
| 476 | { |
| 477 | "search_query": search_query, |
| 478 | "id_list": id_list, |
| 479 | "start": 0, |
| 480 | "max_results": max_results, |
| 481 | } |
| 482 | ) |
| 483 | try: |
| 484 | xml_content = http_get_text(f"https://export.arxiv.org/api/query?{params}") |
| 485 | except Exception: |
| 486 | return [] |
| 487 | if not normalize_whitespace(xml_content): |
| 488 | return [] |
| 489 | try: |
| 490 | return parse_arxiv_xml(xml_content) |
| 491 | except Exception: |
| 492 | return [] |
| 493 | |
| 494 | |
| 495 | def safe_fetch_arxiv_entries(*, search_query: str = "", id_list: str = "", max_results: int = 10) -> list[dict[str, Any]]: |