{"id":1075,"library":"arxiv","title":"arXiv Python API Wrapper","description":"The `arxiv` library is a Python wrapper for the arXiv API, providing programmatic access to over a million scholarly articles in physics, mathematics, computer science, and other fields. It allows users to search, retrieve metadata, and download papers from the arXiv open-access repository. The library is actively maintained with frequent minor and patch releases.","status":"active","version":"2.4.1","language":"python","source_language":"en","source_url":"https://github.com/lukasschwab/arxiv.py","tags":["arxiv","academic","research","api-wrapper","scientific"],"install":[{"cmd":"pip install arxiv","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Used for making HTTP requests to the arXiv API.","package":"requests","optional":false}],"imports":[{"note":"Submodule-style imports were deprecated in v2.1.0; direct import from `arxiv` is now the canonical way.","wrong":"from arxiv.arxiv import Client","symbol":"Client","correct":"from arxiv import Client"},{"symbol":"Search","correct":"from arxiv import Search"},{"symbol":"Result","correct":"from arxiv import Result"},{"symbol":"SortCriterion","correct":"from arxiv import SortCriterion"},{"symbol":"SortOrder","correct":"from arxiv import SortOrder"}],"quickstart":{"code":"import arxiv\n\n# Construct the default API client\nclient = arxiv.Client()\n\n# Search for the 10 most recent articles matching 'quantum'\nsearch = arxiv.Search(\n  query = \"quantum\",\n  max_results = 10,\n  sort_by = arxiv.SortCriterion.SubmittedDate,\n  sort_order = arxiv.SortOrder.Descending\n)\n\nfor result in client.results(search):\n  print(f\"Title: {result.title}\")\n  print(f\"Authors: {', '.join(author.name for author in result.authors)}\")\n  print(f\"Published: {result.published}\")\n  # Example: download PDF to current directory (note deprecation warning in v2.3.0)\n  # result.download_pdf(dirpath='./downloads')","lang":"python","description":"This example demonstrates how to initialize the API client, perform a search for articles, and iterate through the results to print their titles, authors, and publication dates."},"warnings":[{"fix":"Upgrade to Python 3.9 or newer. The library officially supports Python 3.9 through 3.13.","message":"Python 3.7 and 3.8 are no longer officially supported as of version 2.2.0. While existing code might still run, CI validation has ceased for these versions, and future compatibility is not guaranteed.","severity":"breaking","affected_versions":">=2.2.0"},{"fix":"Use direct imports from the top-level `arxiv` package, e.g., `import arxiv` or `from arxiv import Client, Search`.","message":"Submodule-style imports like `import arxiv.arxiv` or `from arxiv import arxiv` were deprecated in version 2.1.0.","severity":"deprecated","affected_versions":">=2.1.0"},{"fix":"Implement custom download logic using `result.pdf_url` or `result.links` to fetch content, or use a dedicated download manager.","message":"Direct download helper methods (e.g., `result.download_pdf()`, `result.download_source()`) were deprecated in version 2.3.0. While they might still function, their use is discouraged.","severity":"deprecated","affected_versions":">=2.3.0"},{"fix":"Ensure you are on the latest patch release (>=2.3.2) to avoid the temporary fallback logic.","message":"Version 2.3.1 introduced a fallback for missing titles by string matching `/pdf/`, which was reverted in 2.3.2 due to potential issues. If you encountered unexpected title parsing behavior around this version, it might have been related to this change.","severity":"gotcha","affected_versions":"2.3.1"},{"fix":"When creating an `arxiv.Client`, consider setting `delay_seconds` (e.g., `client = arxiv.Client(delay_seconds=3.0)`) especially for scripts making many requests. Cache results where possible.","message":"The arXiv API requests that users 'make no more than one request every three seconds'. The library's `Client` can be configured with `delay_seconds` to respect this, but excessive unthrottled requests can lead to IP blocking by arXiv.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'academ':62 'access':18,48 'activ':53 'allow':34 'api':3,15,65 'api-wrapp':64 'articl':24 'arxiv':1,6,14,45,61 'comput':28 'download':41 'field':32 'frequent':56 'librari':7,51 'maintain':54 'mathemat':27 'metadata':39 'million':22 'minor':57 'open':47 'open-access':46 'paper':42 'patch':59 'physic':26 'programmat':17 'provid':16 'python':2,10 'releas':60 'repositori':49 'research':63 'retriev':38 'scholar':23 'scienc':29 'scientif':67 'search':37 'user':35 'wrapper':4,11,66","created_at":"2026-04-02T03:17:35.578242+00:00","updated_at":"2026-04-15T21:05:27.732639+00:00","problems":[{"fix":"pip install arxiv","cause":"The 'arxiv' library is not installed in the Python environment.","error":"ModuleNotFoundError: No module named 'arxiv'"},{"fix":"Ensure you have the latest version of the 'arxiv' library installed: pip install --upgrade arxiv","cause":"The 'Client' class is not available in the 'arxiv' module, possibly due to an outdated version.","error":"ImportError: cannot import name 'Client' from 'arxiv'"},{"fix":"Verify the correct import statement: from arxiv import Search; and ensure the library is up to date: pip install --upgrade arxiv","cause":"The 'Search' class is not found in the 'arxiv' module, likely due to an incorrect import or outdated library version.","error":"AttributeError: module 'arxiv' has no attribute 'Search'"},{"fix":"Check the search query parameters to ensure they are valid and likely to return results.","cause":"The 'arxiv' API returned no results, leading to an attempt to iterate over a 'None' object.","error":"TypeError: 'NoneType' object is not iterable"},{"fix":"Verify your internet connection and check the arXiv API status; consider implementing retry logic with exponential backoff.","cause":"Network issues or the arXiv API being down, causing connection attempts to fail.","error":"requests.exceptions.ConnectionError: HTTPSConnectionPool(host='export.arxiv.org', port=443): Max retries exceeded"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.0.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/lukasschwab/arxiv.py","docs":"https://lukasschwab.me/arxiv.py/","changelog":null,"pypi":"https://pypi.org/project/arxiv/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data","ai-ml"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":"verified"}}