Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

ArXiv API

The ArXiV API allows programmatic access to the arXiv’s e-print content and metadata. “The goal of the interface is to facilitate new and creative use of the the vast body of material on the arXiv by providing a low barrier to entry for application developers.” https://arxiv.org/help/api

The API’s user manual (https://arxiv.org/help/api/user-manual) provides helpful documentation for using the API and retrieving article metadata.

Our examples below will introduce you to the basics of querying the ArXiV API.

Install Packages

Query the API

Perform a simple query for “graphene.” We’ll limit results to the titles of the 10 most recent papers.

A family of ideal Chern flat bands with arbitrary Chern number in chiral twisted graphene multilayers
Correlated insulators, density wave states, and their nonlinear optical response in magic-angle twisted bilayer graphene
Gate-versus defect-induced voltage drop and negative differential resistance in vertical graphene heterostructures
Enhancing the hybridization of plasmons in graphene with 2D superconductor collective modes
Anisotropy of the proton kinetic energy as a tool for capturing structural transition in nanoconfined H$_2$O
Metal-Insulator transition in strained Graphene: A quantum Monte carlo study
Non-perturbative field theoretical aspects of graphene and related systems
Hierarchy of Ideal Flatbands in Chiral Twisted Multilayer Graphene Models
Inducing a topological transition in graphene nanoribbons superlattices by external strain
Engineering the Electronic Structure of Two-Dimensional Materials with Near-Field Electrostatic Effects of Self-Assembled Organic Layers

Do another query for the topic “quantum dots,” but note that you could swap in a topic of your liking.

You can define a custom arXiv API client with specialized pagination behavior. This time we’ll process each paper as it’s fetched rather than exhausting the result-generator into a list; this is useful for running analysis while the client sleeps.

Because this arxiv.Search doesn’t bound the number of results with max_results, it will fetch every matching paper (roughly 10,000). This may take several minutes.

Organize and analyze your results

Create a dataframe to better analyze your results. This example uses Python’s vars built-in function to convert search results into Python dictionaries of paper metadata.

We’ll look at the first 10 results.

Loading...

Next, we’ll create list of all of the columns in the dataframe to see what else is there:

['entry_id', 'updated', 'published', 'title', 'authors', 'summary', 'comment', 'journal_ref', 'doi', 'primary_category', 'categories', 'links', 'pdf_url', '_raw']

We have 14 columns overall. We’ll add two derived columns––the name of the first listed author and a reference to the original arxiv.Result object-–then narrow the dataframe to paper titles, published dates, and first authors to run some analysis of publishing patterns over time.

Loading...

Visualize your results

Get a sense of the how your topic has trended over time. When did research on your topic take off? Create a bar chart of the number of articles published in each year.

<Figure size 432x288 with 1 Axes>

Explore authors to see who is publishing your topic. Group by author, then sort and select the top 20 authors.

first_author Bing Dong 27 Y. Alhassid 20 Constantine Yannouleas 18 David M. -T. Kuo 16 Akira Oguri 15 Xuedong Hu 15 Kicheon Kang 14 B. Szafran 14 Rafael Sánchez 14 Massimo Rontani 14 Ulrich Hohenester 14 C. W. J. Beenakker 13 P. W. Brouwer 13 O. Entin-Wohlman 12 G. Giavaras 12 Vidar Gudmundsson 12 Piotr Trocha 12 Arka Majumdar 11 A. A. Aligia 11 Ramin M. Abolfath 11 Name: first_author, dtype: int64

Identify and download papers

Let’s download the oldest paper about quantum dots co-authored by Piotr Trocha:

Loading...

Confirm that the PDF has downloaded!