Integrations › Google Sheets
Zapi for Google Sheets
Pull data from any source into a sheet with a short Apps Script. Paste it once, then run it by hand or on a timer.
- 01Save your key
In your sheet, open Extensions → Apps Script. Paste this with your key, run it once, then delete it. The key stays in the script’s properties, not in a cell.
function saveKey() { PropertiesService.getScriptProperties().setProperty("ZAPI_KEY", "zpi_..."); }
- 02Pull data into rows
Put TikTok usernames in column A of the first tab, under a header row. This fills followers in column B and videos in column C. Google asks for permission on the first run.
function updateFollowers() { const key = PropertiesService.getScriptProperties().getProperty("ZAPI_KEY"); const sheet = SpreadsheetApp.getActiveSpreadsheet().getSheets()[0]; const last = sheet.getLastRow(); if (last < 2) return; sheet.getRange(2, 1, last - 1, 1).getValues().forEach(([name], i) => { if (!name) return; const res = UrlFetchApp.fetch( "https://api.zapi.ink/v1/social-media:tiktok-scraper/profile?username=" + encodeURIComponent(name), { headers: { "x-api-key": key }, muteHttpExceptions: true }, ); // 429: per-minute limit hit, this row waits for the next run if (res.getResponseCode() !== 200) return; const { data } = JSON.parse(res.getContentText()); sheet.getRange(i + 2, 2, 1, 2).setValues([[data.followerCount, data.videoCount]]); }); }
- 03Run it on a timer
Run this once and the sheet refreshes every day. Each run uses Zap like any API call.
function everyDay() { ScriptApp.newTrigger("updateFollowers").timeBased().everyDays(1).create(); }
The response
200 OK{
"project": "social-media:tiktok-scraper:profile",
"data": {
"username": "tiktok",
"nickname": "TikTok",
"verified": true,
"followerCount": 92400000,
"videoCount": 1310
},
"timestamp": "2026-12-01T07:00:00.000Z"
}Questions
Do I need to know JavaScript?
No. Paste the script, save your key and run it. For other data, change the URL to another source and the fields you write.
Can people I share the sheet with see my key?
It is not in any cell. Anyone who can edit the sheet can open its script, so give edit access only to people you trust with the key.
Why was a row not updated?
That call did not return 200. A 429 means you hit your plan’s per-minute limit; run the script again a minute later.
Your first call in a minute.
Free key, every source, and the same JSON shape from anywhere.