Exploring the National Archives Catalog API: A Guide for Beginners
In this article, we will walk you through the process of running an API call on the National Archives Catalog and retrieving your Universally Unique Identifier (UUID).
Step 1: Open the Command-Line Interface (CLI)
Start by opening the Command-Line Interface (CLI) on your Windows, Mac, or Linux system.
Step 2: Check if curl is installed
Check if curl is installed on your system. Windows may have it by default, while Mac and Linux typically have it pre-installed.
Step 3: Obtain your API key
To interact with the National Archives Catalog API, you'll need an API key. Reach out to the Catalog engineers to obtain one.
Step 4: Run the curl command
Once you have your API key, run the curl command with your API key to make an API call.
Step 5: View the response
The response from the API will be in JSON format, displaying the data you requested. In this case, the response contains the parameter , which is your UUID.
Step 6: Optionally, save the output
You can choose to save the output to a file instead of viewing it in the terminal.
Retrieving a UUID through a GET request
Running a Catalog API GET request with the will retrieve your UUID. Clicking on your most recently added contribution will take you to the URL for the Catalog record and include the .
Writing to the National Archives Catalog via the API
To write to the National Archives Catalog API, a Catalog user ID in the format of a Universally Unique Identifier (UUID) is required. The process involves:
- Authenticate with the API: Obtain API credentials and generate an API token or key if required to authenticate your requests.
- Prepare the user contribution data: Structure the contribution data according to the API’s required JSON or XML schema.
- Send the contribution request: Use the appropriate HTTP method (usually POST) to submit the contribution data to the designated endpoint for contributions in the Catalog API.
- Receive and parse the response: Upon successful submission, the API typically returns a response containing metadata about the contribution, including a unique identifier for the record.
- Store or use the UUID: Use the returned UUID to reference, update, or retrieve the specific contribution in future API operations.
For a precise workflow and API endpoints, consult the official National Archives Catalog API documentation or developer guides, which detail exact parameter names, authentication requirements, request payload formats, and response formats.
Sample API query
Here's a sample read-only API query for retrieving a list of NAIDs for sound recordings related to "Project Blue Book" that are available online.
For more information about query parameters or use cases for the Catalog API, please visit the Catalog API GitHub or see our Swagger documentation.
Read also:
- U Power's strategic collaborator UNEX EV has inked a Letter of Intent with Didi Mobility to deploy UOTTA(TM) battery-swapping electric vehicles in Mexico.
- Gold nanorod market to reach a value of USD 573.3 million by 2034, expanding at a compound annual growth rate (CAGR) of 11.7%
- Advancing Seismic Exploration in Oil and Gas Block VIII, Cambodia by Angkor Resources, using Enercam technology.
- Data Transport Regulations: Deciphering Crucial Legal Guidelines