DOI API integration examples
These examples call the one public AUN capability. No account, API key, wallet or payment is required. The examples send the requested DOI to AUN and Crossref.
curl
curl --get 'https://agentutility.network/api/doi' --data-urlencode 'doi=10.1038/nphys1170'
Python standard library
import json
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import HTTPError
url = "https://agentutility.network/api/doi?" + urlencode({"doi": "10.1038/nphys1170"})
try:
with urlopen(url, timeout=15) as response:
metadata = json.load(response)
print(metadata["title"], metadata["provenance"]["source_url"])
except HTTPError as error:
print("Request failed:", error.code)JavaScript
const query = new URLSearchParams({doi: '10.1038/nphys1170'});
const response = await fetch('https://agentutility.network/api/doi?' + query);
const data = await response.json();
if (!response.ok) throw new Error(data.error || `HTTP ${response.status}`);
console.log(data.title, data.authors, data.provenance);Interpreting the response
The sample DOI identifies “Measured measurement” by Markus Aspelmeyer in Nature Physics, published in 2009. Fields can be null, authors may be truncated, and date arrays may contain only a year or year/month. Preserve the provider's precision rather than inventing a full date.
Handle failures
404 means no Crossref record, not that the DOI cannot exist. 422 indicates missing or invalid input. A shared budget allows a burst of ten DOI requests and replenishes one per second; at most five requests execute concurrently. HTTP 429 includes Retry-After. Back off rather than retrying in a tight loop. Upstream failure or throttling returns 502/503.
Full response fields · What provenance does and does not prove.