# How to pull in data from a web-based spreadsheet (GSheet, Airtable)?

**URL:** <https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086>\
**Category:** Uncategorized\
**Created:** [October 14, 2020, 8:28pm UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086 "2020-10-14T20:28:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Koos](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Koos](https://talk.jekyllrb.com/u/Koos)\
**Post date:** [October 14, 2020, 8:28pm UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/1 "2020-10-14T20:28:59Z")

</div>

There’s the jekyll-airtable\_data plugin to pull in data from Airtable, but it [doesn’t seem to work](https://github.com/danklammer/jekyll-airtable_data/issues/1) with the current Jekyll version. Downloading a Google Sheet as CSV with `curl`/`wget` no longer seems to work. I found the jekyll-gdrive plugin to pull in data from Google Sheets, but it’s no longer maintained. The documentation says "Once you have the token, you need to set it up as an environment variable before running `jekyll build`" but I don’t know where to set it.

Has anyone here been successful with this?

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [October 14, 2020, 11:20pm UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/2 "2020-10-14T23:20:44Z")

</div>

did you read this recent post? might help.

> [@Using Google Forms for Jekyll Comments](https://talk.jekyllrb.com/t/using-google-forms-for-jekyll-comments/5048):
>
> Hey guys, I only recently started using Jekyll and really like it overall and was looking for a free way to add comments to my static blog posts and ended up doing it with Google Forms/Google Sheets. I hadn’t really seen any posts about doing it this way so I wrote a little article about it here: Let me know what you think about the approach! Or even if you have feedback on my writing, that’s always appreciated as well. Thanks!

---

<div class="post-metadata">

**Author:** ![Koos](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Koos](https://talk.jekyllrb.com/u/Koos)\
**Post date:** [October 15, 2020, 5:25am UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/3 "2020-10-15T05:25:28Z")

</div>

Yes, as far as I can tell, that post shows how he pulls in Google Sheet data with JavaScript. I want to import it into Jekyll.

---

<div class="post-metadata">

**Author:** ![Koos](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Koos](https://talk.jekyllrb.com/u/Koos)\
**Post date:** [October 15, 2020, 12:52pm UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/4 "2020-10-15T12:52:48Z")

</div>

Downloading a Google Sheet via `curl` doesn’t seem to work anymore. But I found that Airtable also offers a download option for each table:

```auto
curl -o _data/my_table.json https://api.airtable.com/v0/appuB4YjkdgtWYW1e/links \
-H "Authorization: Bearer YOUR_API_KEY"

```

This downloads a JSON file that Jekyll can handle perfectly fine. I still have to figure out how to automatically run that line when I do `bundle exec jekyll serve`.

---

<div class="post-metadata">

**Author:** ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)\
**Post date:** [October 15, 2020, 9:23pm UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/5 "2020-10-15T21:23:30Z")

</div>

Yes you can use curl to store JSON in data directory and then run Jekyll serve.

You can do that on GH Pages unless you use GH Actions.

I find Netlify is way lighter. no need for setting up a workflow or choosing an action or giving it a token.  
Just configure

```auto
[build]
  command = "./download_sheet.sh && bundle exec jekyll serve"

```

Assuming the curl command is a bash script to make the config lighter and so you only have to write the curl line in one file.

You don’t even have to run install as Netlify does it for you

---

<div class="post-metadata">

**Author:** ![printf](https://avatars.discourse-cdn.com/v4/letter/p/c68b51/32.png) [@printf](https://talk.jekyllrb.com/u/printf)\
**Post date:** [October 16, 2020, 3:24am UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/6 "2020-10-16T03:24:33Z")

</div>

> **[Airtable/airtable-ruby](https://github.com/Airtable/airtable-ruby)**
>
> Access Airtable data sheets with ease using ruby. Contribute to Airtable/airtable-ruby development by creating an account on GitHub.

  
Not sure if this is relevant

---

<div class="post-metadata">

**Author:** ![Koos](https://avatars.discourse-cdn.com/v4/letter/k/2acd7d/32.png) [@Koos](https://talk.jekyllrb.com/u/Koos)\
**Post date:** [October 16, 2020, 8:45am UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/7 "2020-10-16T08:45:34Z")

</div>

[Apparently](https://github.com/Airtable/airtable-ruby/issues/25) airtable-ruby is no longer maintained either 😬 [Airrecord](https://github.com/sirupsen/airrecord) is supposed to be an alternative, but I don’t know how to integrate it with Jekyll.

I’m using a simple bash script for now:

```auto
curl -o _data/my_table.json https://api.airtable.com/v0/appuB4YjkdgtWYW1e/links \
-H "Authorization: Bearer YOUR_API_KEY"
bundle exec jekyll serve --config _config.yml,_config_dev.yml

```

This pulls in the data from Airtable and then starts the dev server. It doesn’t do live/polled updates from Airtable, but this is fine.

---

<div class="post-metadata">

**Author:** ![nayamoss](https://avatars.discourse-cdn.com/v4/letter/n/bcef8e/32.png) [@nayamoss](https://talk.jekyllrb.com/u/nayamoss)\
**Post date:** [October 19, 2020, 8:46am UTC](https://talk.jekyllrb.com/t/how-to-pull-in-data-from-a-web-based-spreadsheet-gsheet-airtable/5086/8 "2020-10-19T08:46:04Z")

</div>

Thanks I kept running into an issue w/ it and I guess this is my answer 😅
