# Fibonacci Generator API

> 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.

**Endpoint:** `GET https://api.apiverve.com/v1/fibonaccigenerator`  
**Category:** Math/Calculations  
**Cost:** 1 credit per call  
**Canonical page:** https://apiverve.com/marketplace/fibonaccigenerator

## Overview

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.

## Authentication

Every call carries your key in an `x-api-key` header. The same key works across the whole
APIVerve catalog — there are no per-API subscriptions. Responses always use the same three
top-level keys: `status`, `error`, and `data`.

## Example request

```bash
curl "https://api.apiverve.com/v1/fibonaccigenerator?count=10&startfrom=0" \
  -H "x-api-key: YOUR_API_KEY"
```

## Parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `count` | integer | Yes | Number of Fibonacci numbers to generate. range 1-1000 |
| `startfrom` | integer | No | Start from this position in the sequence. default 0. range 0-10000 |

## Response fields

- `sequence` — array · Array of generated Fibonacci numbers
- `count` — number · Total count of Fibonacci numbers generated
- `start_from` — number · Starting position in the Fibonacci sequence
- `first_value` — number · First value in the generated sequence
- `last_value` — number · Last value in the generated sequence
- `sum` — number · Sum of all numbers in the sequence
- `ratios` — array · Array of ratios between consecutive sequence values
- `golden_ratio_approximation` — number · Approximation of golden ratio from sequence ratios

## Sample response

```json
{
  "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
  }
}
```

## Use cases

- **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

## SDKs

- **npm** — `npm install @apiverve/fibonaccigenerator` (https://www.npmjs.com/package/@apiverve/fibonaccigenerator)
- **NuGet** — `dotnet add package APIVerve.API.FibonacciGenerator` (https://www.nuget.org/packages/APIVerve.API.FibonacciGenerator)
- **Source** — https://github.com/apiverve/fibonaccigenerator-api

## More

- Full reference: https://docs.apiverve.com/ref/fibonaccigenerator
- Get an API key: https://dashboard.apiverve.com
- Full catalog: https://apiverve.com/marketplace
