Skip to main content

API Data to Excel

Fetch data from REST API and save to Excel file

Steps

#ActivityWhat it does
1HttpRequestCall the API endpoint
2CreateTableCreate an in-memory table for the API rows
3ForEachLoopIterate over the API response items
4TableUpsertRowAppend each item to the table
5TableExportExport the rows to Excel

Workflow

apiResponse = HttpRequest("https://api.example.com/data", "GET")
CreateTable("apiData", schema={"columns": [{"name": "id"}, {"name": "name"}, {"name": "value"}]})
for item in apiResponse.items:
TableUpsertRow("apiData", {"id": "{{ item.id }}", "name": "{{ item.name }}", "value": "{{ item.value }}"}, append=True)
TableExport("apiData", "./output.xlsx", format="xlsx", sheetName="Data")