OEIS APIoeis.org ↗
Search and retrieve integer sequences from the On-Line Encyclopedia of Integer Sequences. Look up by A-number, keyword, or known terms. 4 endpoints.
What is the OEIS API?
The OEIS API provides 4 endpoints for searching and retrieving integer sequences from the On-Line Encyclopedia of Integer Sequences. Use search_sequences to find entries by keyword or A-number, get_sequence to pull full metadata for a specific entry including formulas, comments, and author, get_sequence_data to retrieve raw indexed term pairs from a sequence's b-file, and search_by_sequence to identify an unknown sequence from its known values.
curl -X GET 'https://api.parse.bot/scraper/970d2964-672b-4fa3-ac30-0a50d22952e0/search_sequences?limit=5&query=fibonacci&offset=0' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace oeis-org-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: OEIS API — search sequences, drill into details, fetch raw terms."""
from parse_apis.oeis_api import Oeis, SequenceNotFound
client = Oeis()
# Search for sequences by keyword — limit caps total items fetched.
for summary in client.sequencesummaries.search(query="catalan", limit=3):
print(summary.a_number, summary.name, summary.comment_count)
# Identify a sequence from its terms.
match = client.sequencesummaries.search_by_values(sequence="1,1,2,3,5,8,13", limit=1).first()
if match:
print(match.a_number, match.name, match.has_formula)
# Drill into the full detail of a summary result.
if match:
detail = match.details()
print(detail.name, detail.author, detail.keyword)
# Fetch a sequence directly by A-number and retrieve raw computed terms.
seq = client.sequences.get(a_number="A000045")
for term in seq.terms(num_terms=10, limit=10):
print(term.n, term.value)
# Handle a not-found sequence gracefully.
try:
client.sequences.get(a_number="A999999")
except SequenceNotFound as exc:
print(f"Not found: {exc.a_number}")
print("exercised: sequencesummaries.search / search_by_values / details / sequences.get / terms")
Full-text search over OEIS sequences by keyword, A-number, or description. Returns summary information (A-number, name, initial terms, counts of comments/references/links, presence of formula/example) for each match. Paginates via offset. OEIS returns empty results for overly broad queries matching too many sequences; use specific terms or A-numbers.
| Param | Type | Description |
|---|---|---|
| limit | integer | Maximum number of results to return. |
| queryrequired | string | Search query: keywords, A-number like A000045, or sequence description. Overly broad terms may return empty results due to OEIS query limits. |
| offset | integer | Starting position for pagination. |
{
"type": "object",
"fields": {
"limit": "integer, limit used",
"query": "string, the search query submitted",
"total": "integer, number of results returned",
"offset": "integer, offset used",
"results": "array of SequenceSummary objects with a_number, id, name, data, comment_count, reference_count, link_count, has_formula, has_example"
},
"sample": {
"data": {
"limit": 5,
"query": "fibonacci",
"total": 5,
"offset": 0,
"results": [
{
"id": "M0692 N0256",
"data": "0,1,1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,4181",
"name": "Fibonacci numbers: F(n) = F(n-1) + F(n-2) with F(0) = 0 and F(1) = 1.",
"a_number": "A000045",
"link_count": 250,
"has_example": true,
"has_formula": true,
"comment_count": 179,
"reference_count": 60
}
]
},
"status": "success"
}
}About the OEIS API
Search and Lookup
The search_sequences endpoint accepts a query string — a keyword phrase, a description fragment, or a direct A-number like A000045 — and returns an array of sequence summaries. Each summary includes a_number, name, data (the initial comma-separated terms), and metadata counts: comment_count, reference_count, link_count, has_formula, and has_example. Pagination is controlled via limit and offset. Note that overly broad queries such as prime return empty results; use specific phrases like prime gap or twin prime instead.
Full Sequence Detail
The get_sequence endpoint takes an a_number — either the full form A000045 or a bare integer like 45, which is automatically zero-padded — and returns the complete OEIS entry. Response fields include name, data, formula (array of formula strings), comment (array of annotation strings), example, link (HTML link strings), author, keyword, offset, and the legacy id codes. This is the right endpoint when you need the mathematical context around a sequence, not just its terms.
Raw Term Data
The get_sequence_data endpoint returns structured term data in b-file format: an array of objects each containing an integer index n and its corresponding value a(n). The optional num_terms parameter caps the number of returned terms; omitting it returns all available terms for the sequence. The response also includes a_number in canonical form and total_terms as a count.
Identify a Sequence from Its Terms
The search_by_sequence endpoint accepts a comma-separated string of known values — for example 1,1,2,3,5,8,13 — and returns matching sequence summaries in the same shape as search_sequences results, including a_number, name, data, and availability flags. This is useful when you have computed values and need to identify the underlying mathematical sequence.
The OEIS API is a managed, monitored endpoint for oeis.org — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when oeis.org changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official oeis.org API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Identify an unknown integer sequence by supplying its first several terms to
search_by_sequence - Build a math reference tool that fetches full entry detail — formulas, comments, and examples — via
get_sequence - Extract all indexed term pairs for a sequence using
get_sequence_datato populate a local numerical dataset - Search for sequences related to a mathematical concept using keyword queries in
search_sequences - Look up a known A-number programmatically to retrieve author attribution and keyword classification
- Cross-reference computed sequence values against OEIS entries to validate a new integer formula
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.
Does OEIS have an official developer API?+
fmt=json parameter is included, but it is not documented as a formal developer API and has no official versioning, authentication, or support channel.Why does my `search_sequences` query return empty results?+
prime or number trigger this behavior. Use more specific phrases such as prime gap, Sophie Germain prime, or Fibonacci divisibility to get results. The total field in the response will be 0 when this occurs.What does `get_sequence_data` return that `get_sequence` does not?+
get_sequence returns the data field as a short comma-separated string of initial terms. get_sequence_data returns the full b-file content as a structured array of {n, a(n)} integer pairs, potentially covering thousands of terms. Use num_terms to limit the response to a specific count.Does the API expose cross-references between sequences?+
get_sequence endpoint does return comment and link arrays that may contain cross-reference mentions in text or HTML form, but there is no dedicated xref array or parsed list of related A-numbers in the response schema. You can fork this API on Parse and revise it to extract and surface the cross-reference data as a structured field.Is it possible to filter `search_sequences` results by keyword tags like `base`, `nonn`, or `fini`?+
search_sequences endpoint accepts a free-text query and does not expose a dedicated keyword filter parameter. The keyword field is returned on individual entries via get_sequence. You can fork this API on Parse and revise it to add keyword-based filtering as an explicit input parameter.