# XLSX API To Sheet

Fetch JSON from REST or GraphQL API and write mapped records into an Excel sheet with automatic pagination

> Canonical page: https://elysiatools.com/en/tools/xlsx-api-to-sheet

- **Category:** Format Conversion

- **Keywords:** xlsx, api, rest, graphql, pagination, json, mapping

## Overview

Load remote API data directly into a worksheet.

- Supports REST and GraphQL response payloads
- Auto pagination with page/offset/cursor strategies
- Optional field mapping from nested JSON paths
- Exports result as XLSX file

## Inputs

- **Source Type** (select)
- **API URL** (text): https://api.example.com/items
- **REST Method** (select)
- **Headers JSON** (textarea): {"Authorization":"Bearer xxx"}
- **Query Params JSON** (textarea): {"status":"active"}
- **REST Body JSON** (textarea): {"filters":{"status":"active"}}
- **GraphQL Query** (textarea): query($page:Int,$limit:Int){ items(page:$page,limit:$limit){ id name } }
- **GraphQL Variables JSON** (textarea): {"status":"active"}
- **Data Path** (text): data.items
- **Pagination Type** (select)
- **Max Pages** (number)
- **Page Param** (text)
- **Page Start** (number)
- **Page Size Param** (text)
- **Page Size** (number)
- **Offset Param** (text)
- **Offset Start** (number)
- **Cursor Param** (text)
- **Cursor Start** (text)
- **Has More Path** (text): data.pageInfo.hasNextPage
- **Next Cursor Path** (text)
- **Total Pages Path** (text): meta.totalPages
- **Field Mapping JSON** (textarea): {"customer":"data.customer.name","amount":"amount"}
- **Sheet Name** (text)
- **Output File Name** (text): api-export

## When to use

- When you need to export live data from a REST or GraphQL API into an Excel format for reporting.
- When your API data is spread across multiple pages and requires automated fetching to consolidate into one file.
- When you need to extract specific nested fields from a JSON response and map them to custom column headers.

## How it works

- Select your API source type (REST or GraphQL) and provide the endpoint URL.
- Configure pagination settings if your data spans multiple pages using page, offset, or cursor strategies.
- Define your field mapping as a JSON object to map specific JSON paths to your desired Excel column names.
- Execute the request to automatically fetch, parse, and generate your downloadable XLSX file.

## Use cases

- Generating weekly inventory reports by pulling live stock levels from an internal REST API.
- Consolidating customer feedback data from a GraphQL endpoint into a single spreadsheet for analysis.
- Automating the export of paginated transaction logs from a payment gateway API into Excel.

## Frequently asked questions

### Does this tool support GraphQL?

Yes, you can select GraphQL as the source type and provide your query and variables in the configuration fields.

### How does the pagination feature work?

The tool supports page, offset, and cursor strategies. It automatically requests subsequent pages based on your configuration until the data is fully retrieved or the max page limit is reached.

### Can I rename columns in the output file?

Yes, use the Field Mapping JSON field to map specific JSON paths from your API response to your preferred column headers.

### Is there a limit to how much data I can fetch?

You can configure the 'Max Pages' setting to control the depth of the data retrieval, with a default limit of 50 pages.

### What output formats are supported?

The tool generates and exports your data exclusively as an XLSX file.

## Related tools

- [Text to Excel Converter](https://elysiatools.com/en/tools/text-to-excel): Convert various text formats to Excel with customizable parsing and formatting options
- [XLSX Chart Embedder](https://elysiatools.com/en/tools/xlsx-chart-embedder): Embed generated chart images into Excel workbooks using workbook data ranges for bar or pie chart reports
- [XLSX Conditional Formatting Rule](https://elysiatools.com/en/tools/xlsx-conditional-formatting-rule): Batch-apply conditional formatting rules such as threshold highlights, data bars, and color scales to Excel worksheets
- [XLSX JSON Transformer](https://elysiatools.com/en/tools/xlsx-json-transformer): Bidirectional conversion between JSON arrays and Excel sheets, with nested object flattening and restoration
- [XLSX Multi Sheet Splitter](https://elysiatools.com/en/tools/xlsx-multi-sheet-splitter): Split a multi-sheet workbook into independent files by sheet name, with ZIP output
- [XLSX Parquet Exporter](https://elysiatools.com/en/tools/xlsx-parquet-exporter): Export worksheet data to Parquet and/or NDJSON for data lake and data warehouse pipelines
- [XLSX Print Setup Pack](https://elysiatools.com/en/tools/xlsx-print-setup-pack): Apply paper, margins, scaling, repeating titles, and header/footer print settings to Excel workbooks in one pass
- [XLSX Range Extractor](https://elysiatools.com/en/tools/xlsx-range-extractor): Extract a specific sheet/range/named-range from Excel into JSON with coordinates or record objects

## Samples

- [XLSX Samples](https://elysiatools.com/en/samples/xlsx-samples): Sample XLSX spreadsheets for worksheet parsing and data extraction testing
- [Postman Collections - API Testing](https://elysiatools.com/en/samples/postman-collections): Comprehensive Postman collection examples including API testing, automation scripts, environment variables, mock servers, and advanced testing patterns for REST APIs
- [XLS Samples](https://elysiatools.com/en/samples/xls-samples): Sample legacy Excel (XLS) files for binary spreadsheet parsing and import tests
- [OpenAPI/Swagger Samples](https://elysiatools.com/en/samples/openapi-swagger): Comprehensive API documentation examples using OpenAPI 3.0 and Swagger specifications for RESTful services

## Related content

- [XLSX ETL Ingestion and Warehouse Handoff](https://elysiatools.com/en/hubs/xlsx-etl-ingestion-workflows): Turn mixed workbook and CSV sources into traceable, schema-aware outputs for SQL loading, Parquet pipelines, and object-storage batch handoff.
- [KPI Report Pack Workflows](https://elysiatools.com/en/hubs/kpi-report-pack-workflows): Turn API and spreadsheet data into KPI dashboards, multi-tab Excel report packs, branded sheets, charts, sparklines, and executive PDF or Markdown reports.
