Back to articles
How to Scrape Notion, Airtable, and Google Sheets (Public Data)

How to Scrape Notion, Airtable, and Google Sheets (Public Data)

via Dev.to JavaScriptАлексей Спинов

Many businesses share data through Notion pages, Airtable bases, and Google Sheets. Here is how to access them. Google Sheets (Easiest) Published Google Sheets have a JSON endpoint: https://docs.google.com/spreadsheets/d/SHEET_ID/gviz/tq?tqx=out:json async function getGoogleSheet ( sheetId ) { const url = `https://docs.google.com/spreadsheets/d/ ${ sheetId } /gviz/tq?tqx=out:json` ; const res = await fetch ( url ); const text = await res . text (); // Remove callback wrapper const json = JSON . parse ( text . match ( /google.visualization.Query.setResponse \(( .* )\) / s )[ 1 ]); return json . table ; } Notion (API) Notion has a free API: async function getNotionPage ( pageId , token ) { const res = await fetch ( `https://api.notion.com/v1/pages/ ${ pageId } ` , { headers : { Authorization : `Bearer ${ token } ` , " Notion-Version " : " 2022-06-28 " } }); return res . json (); } Airtable (API) Airtable API is free with your account: https://api.airtable.com/v0/BASE_ID/TABLE_NAME?api_ke

Continue reading on Dev.to JavaScript

Opens in a new tab

Read Full Article
7 views

Related Articles