NewAPIVerve Academy: free courses and certifications anyone can verify.Explore the Academy →

Fibonacci Generator API

GET

Calculate Fibonacci numbers and golden ratios for any range.

Fibonacci Generator computes Fibonacci numbers and sequences based on a target count or ceiling value. Each response provides the generated sequence starting from any position, total sum, step ratios, and a golden ratio approximation.

Try it — live request, no key required

Request
GETapi.apiverve.com/v1/fibonaccigenerator?count=10
Query parameters
Verification
Format

No key required to try it. Get a key to use it in your app.

Example
{
  "status": "ok",
  "error": null,
  "data": {
    "sequence": [
      0,
      1,
      1,
      2,
      3,
      5,
      8,
      13,
      21,
      34
    ],
    "count": 10,
    "start_from": 0,
    "first_value": 0,
    "last_value": 34,
    "sum": 88,
    "ratios": [
      1.666667,
      1.6,
      1.625,
      1.615385,
      1.619048
    ],
    "golden_ratio_approximation": 1.619048
  }
}

About the Fibonacci Generator API

Fibonacci Generator returns Fibonacci numbers using the classic rule where each number is the sum of the two preceding ones. Ask for a fixed count of terms, or for every term up to a ceiling value, and optionally begin later in the sequence instead of at zero. Each response carries the sequence itself, its first and last values, the sum, the most recent ratios between neighbouring terms and the golden ratio approximation those ratios converge on.

It is used to seed math exercises and coding tests, to build Fibonacci retracement levels or spacing scales, to generate test data for number sequence functions, and to show students how quickly the ratio settles near 1.618.

Every field is available on the Free plan. Terms are computed exactly on the server; only very large terms lose their last digits when written out as JSON numbers.

How it works

The Fibonacci Generator has two modes that share one response shape. With count (1 to 1000) it returns that many terms. With maxvalue it returns every term that does not exceed the ceiling, with a hard stop at 5,000 terms. startfrom (0 to 10,000) advances the generator before output begins. At the default of 0 the sequence opens with 0, 1, 1, 2 and the leading 0 counts toward count; at any higher value the first term returned is F(startfrom + 1), so startfrom=10 begins at 89.

Terms and the running sum are accumulated as exact big integers and converted to JSON numbers only when the response is built. A JSON number holds integers exactly only up to 2^53, so from F(79) onward the returned digits are the nearest representable value rather than the exact term, and beyond roughly F(1476) a term is too large for a number at all and serialises as null. For exact large values, use the sequence for its shape and compute the digits client-side.

ratios divides each term by the one before it, skipping any division by zero, rounds to six decimal places and keeps only the last five. golden_ratio_approximation is the final ratio, or null when the sequence is too short to form one, for example a single term. first_value, last_value and count describe the returned array, and start_from echoes the offset used.

What people use it for

Math Education
Teach Fibonacci sequences and golden ratio concepts in educational applications and tools
Algorithm Testing
Generate test data for algorithms and performance testing using Fibonacci sequences
Visual Design
Apply Fibonacci ratios and golden ratio proportions in design and layout calculations
Data Analysis
Use Fibonacci numbers in technical analysis, trading algorithms, and pattern recognition

Ways to call it

One endpoint, many ways in — REST with JSON, XML, YAML and CSV, plus GraphQL and an MCP interface for AI agents.

JSON
Default REST response
XML
Markup format
YAML
Human-readable
CSV
Tabular export
Beta
GraphQL
Query language
New
MCP
For AI agents

Other ways to use Fibonacci Generator

Same data, same APIVerve account, same credit balance — one key works on all of them.

Questions.

Common questions about the Fibonacci Generator API.

Read the docs →
Can I generate numbers up to a specific value instead of a fixed count?
Yes. The API provides endpoints for both approaches. You can request an exact count of numbers or define a maximum value threshold, which generates sequence numbers up to that limit.
Can I start the sequence from an arbitrary position?
Yes. You can supply a starting position parameter to skip earlier numbers in the sequence. The returned list and all accompanying calculations will begin directly from your chosen index.
Does the API calculate the sum of the generated sequence?
Yes. Every response includes the total sum of all numbers in the generated sequence. It also returns summary details including the total count, first value, and last value.
Are golden ratio approximations and consecutive ratios included?
Yes. Responses automatically provide an array of ratios between consecutive values alongside an overall golden ratio approximation. You do not need to calculate ratios manually from the raw sequence.
Is it cheap enough to generate sequences for every user request?
Yes. Each generation call costs 1 credit, which works out to about $0.00015 per call (or $0.15 per 1,000 calls) on the Starter plan. Starter covers 200,000 calls each month, while the Free plan includes 200 calls per month for testing.

Ready to build with Fibonacci Generator? Start with 200 free credits — one key unlocks all 300+ APIs.

Explore the catalog

300+ APIs on the same key and the same response shape.

Browse all APIs