Getting started overview

OpenAlex offers a comprehensive, openly available database of scholarly works, authors, institutions, and concepts, designed to replace proprietary academic databases like Web of Science and Scopus. The platform provides access through a REST API and a full dataset snapshot for download, both of which are free to use. This guide focuses on quickly making your first API request to retrieve scholarly data. To ensure optimal performance and avoid hitting rate limits, OpenAlex recommends identifying your requests with an email address, though it is not strictly required for initial exploration.

To get started, you will:

  1. Understand the basics of the OpenAlex API.
  2. Identify how to make authenticated versus unauthenticated requests.
  3. Construct and execute your first API call to retrieve data.

Here's a quick reference table outlining the steps:

Step What to Do Where to Find Info
1. Review API Basics Understand data model and query parameters. OpenAlex API documentation
2. Choose Authentication Method Decide whether to use an email for higher rate limits or proceed unauthenticated. OpenAlex rate limits guide
3. Construct Request Formulate your API endpoint and parameters. OpenAlex Getting Started guide
4. Execute Request Use a tool like curl or a programming language HTTP client. MDN HTTP Status Codes reference
5. Interpret Response Parse the JSON data returned by the API. OpenAlex API responses documentation

Create an account and get keys

OpenAlex does not require creating an account or obtaining API keys in the traditional sense. Instead, API access is managed primarily through rate limits, which are more generous for requests that include a user-provided email address. This email acts as a simple identifier, allowing OpenAlex to understand usage patterns and communicate with users if problems arise. There is no formal registration process, no keys to generate, and no dashboard to manage API credentials.

To effectively "authenticate" for higher rate limits, you simply append your email address to your API requests as a query parameter. For example, a request might look like https://api.openalex.org/[email protected]. The inclusion of the mailto parameter increases your allowed request rate significantly, from 10 requests per second to 100 requests per second. Omitting this parameter defaults your requests to the unauthenticated rate limit.

The system is designed for ease of access, prioritizing open availability over stringent authentication mechanisms. This approach facilitates rapid prototyping and integration for developers and researchers.

Your first request

Making your first request to the OpenAlex API involves selecting an endpoint, constructing the URL with any desired filters or search terms, and executing an HTTP GET request.

Example 1: Unauthenticated search for works

Let's find recent works related to "artificial intelligence" without providing an email. This request will be subject to the default unauthenticated rate limit of 10 requests per second.

curl "https://api.openalex.org/works?search=artificial%20intelligence&sort=publication_date:desc&per-page=5"

This command:

  • Targets the /works endpoint.
  • Searches for the phrase "artificial intelligence" in the work's title or abstract.
  • Sorts the results by publication_date in descending order (most recent first).
  • Limits the results to 5 items per page using per-page=5.

Example 2: Authenticated search by author

Now, let's search for works by a specific author, identifying our request with an email address to benefit from the higher rate limit of 100 requests per second. Replace [email protected] with your actual email.

curl "https://api.openalex.org/works?filter=author.id:A2127111584&[email protected]&per-page=10"

In this example:

  • We use the /works endpoint.
  • The filter=author.id:A2127111584 parameter narrows results to a specific author ID. You can find author IDs through initial searches or the OpenAlex interface.
  • [email protected] identifies your usage for higher rate limits.
  • per-page=10 retrieves 10 results.

Example 3: Filtering by concept and year

To retrieve works associated with a particular concept, such as "Computer Science," published within a specific year, you can combine filters. Concept IDs can be discovered via the OpenAlex Concepts API.

curl "https://api.openalex.org/works?filter=concept.id:C15744&filter=publication_year:2023&[email protected]&per-page=5"

This request:

  • Filters works by the concept with ID C15744 (Computer Science).
  • Further filters these results to only include works published in publication_year:2023.
  • Includes the mailto parameter for increased rate limits.

The responses to these requests will be in JSON format, containing an array of scholarly works along with metadata such as title, authors, publication date, and associated concepts. You can learn more about the structure of OpenAlex API responses in the OpenAlex API response formats documentation.

Common next steps

After successfully making your first OpenAlex API request, consider these common next steps to deepen your integration and leverage the full capabilities of the platform:

  1. Explore additional endpoints: Beyond /works, OpenAlex provides endpoints for /authors, /venues, /institutions, /concepts, and /publishers. Each offers distinct data models and query options for comprehensive research analysis. Refer to the OpenAlex API reference for details on each.

  2. Implement pagination: For results exceeding the per-page limit (default is 25, max 200), implement pagination using the page parameter. This allows you to iterate through large result sets efficiently. The OpenAlex pagination guide describes how to retrieve all available data.

  3. Utilize filters and search operators: Explore the extensive filtering capabilities, including logical operators (AND, OR, NOT), range queries, and nested filters. These allow for highly specific data retrieval. Detailed examples are available in the OpenAlex filtering documentation.

  4. Integrate with a programming language: While curl is useful for testing, integrate the API into your preferred programming language (Python, JavaScript, Ruby, etc.) using its HTTP client library. This enables more complex data processing and application development. For instance, using Python's requests library for making HTTP requests is a common practice in web development, as detailed in the MDN Web Docs on HTTP headers.

  5. Understand rate limits and error handling: Familiarize yourself with OpenAlex's rate limits and implement robust error handling in your application, especially for 429 Too Many Requests responses. The OpenAlex rate limits guide provides best practices.

  6. Consider the OpenAlex Snapshot: For very large-scale analysis or if you require the entire dataset for offline processing, the OpenAlex Snapshot is available for download on AWS S3. This provides a complete copy of the database. Information on accessing the snapshot can be found in the OpenAlex data download documentation.

Troubleshooting the first call

Encountering issues with your first API call is common. Here are some troubleshooting tips for OpenAlex:

  • Check URL encoding: Ensure all special characters in your search queries (e.g., spaces, ampersands, question marks) are properly URL-encoded. For example, a space should be %20. Most HTTP client libraries handle this automatically, but when using curl directly or building URLs manually, it's a common oversight. The MDN Web Docs on URL encoding provides details.

  • Verify endpoint and parameter names: Double-check that you are using the correct endpoint (e.g., /works, /authors) and that all filter and parameter names (e.g., search, filter, mailto) are spelled correctly and match the OpenAlex API documentation.

  • Review filter values: If you are filtering by IDs (e.g., author.id, concept.id), ensure the IDs are valid and correctly formatted. Incorrect IDs will result in no data being returned or an error.

  • HTTP status codes: Pay attention to the HTTP status code returned in the response. A 200 OK indicates success. Other codes like 400 Bad Request (often due to malformed URLs or invalid parameters), 404 Not Found (incorrect endpoint), or 429 Too Many Requests (rate limit exceeded) can guide your debugging. A comprehensive list of HTTP status codes explained by MDN can be helpful.

  • Inspect the response body: When an error occurs, the API often returns a JSON response containing an error message. Read these messages carefully, as they usually provide specific information about what went wrong. For example, a 400 error might include details about which parameter was invalid.

  • Check rate limits: If you receive a 429 Too Many Requests status, you have exceeded your current rate limit. If you are not using the mailto parameter, add it to increase your limit. Otherwise, implement exponential backoff or ensure your application respects the allowed request rate. The OpenAlex rate limit documentation has specific advice.

  • Consult OpenAlex documentation: The official OpenAlex documentation is the most authoritative resource for troubleshooting and understanding API behavior. It offers detailed explanations and examples.