Convert Google Sheets into a REST API

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • How to use Google Sheets as a database by turning it into a REST API with Google Apps Script. This makes Google Sheets a powerful tool for managing data online, allowing for easy data entry and retrieval without manual sharing or updating.
    This allows you to add and get data from the sheet over the internet without sharing the sheet. It shows how to:
    Write code in Google Sheets that listens for web requests.
    Use doGet and doPost functions to handle these requests.
    Insert data into the sheet and fetch a summary of this data through the web.
    Deploy the script as a web app to get a URL for accessing the API.
    Test the API with tools like Postman or embed it in a web form.

ความคิดเห็น • 73

  • @nickidewet7711
    @nickidewet7711 3 หลายเดือนก่อน +2

    Brilliant! The first and only video I watched to get a working system that can update google sheet.

    • @BetterSheets
      @BetterSheets  3 หลายเดือนก่อน

      Glad its so useful!

  • @riccardoluise8630
    @riccardoluise8630 6 หลายเดือนก่อน

    0:00 Introduction
    0:40 API Overview and Benefits
    1:01 Project Overview
    2:00 Setting Up App Script
    5:01 Testing the API
    6:39 Debugging
    7:34 Redeploying the Web App
    8:43 Fetching Data with doGet
    9:48 Using ImportData Function
    10:30 Creating and Deploying an Online Form
    12:55 Summary and Conclusion

  • @1lllllllll1
    @1lllllllll1 8 หลายเดือนก่อน +2

    Fantastic! After over an hour watching useless redundant other videos, finally I found yours. Useful, technical, concise, clear. Thank you!

    • @BetterSheets
      @BetterSheets  8 หลายเดือนก่อน

      Glad you enjoyed!

    • @1lllllllll1
      @1lllllllll1 8 หลายเดือนก่อน

      Watching it again and waiting two minutes until you realize the get function is supposed to be a post, phew! I was worried I’m not understanding this. Would have been good to edit that. But I appreciate the real-time and the debugging, makes this a lot more useful.
      Now why does google have a method for insertRows and another for insertRow? Why can’t the plural method handle a single row insert. Seems weird.

  • @onemoreprince
    @onemoreprince 6 วันที่ผ่านมา +1

    its east to keep the deployment URL same, by choosing the manage deployment instead of new deployment and deploying just a new version.

    • @BetterSheets
      @BetterSheets  6 วันที่ผ่านมา

      Yes. Thats true.

  • @hanzo_process
    @hanzo_process 5 หลายเดือนก่อน +1

    amazing! i was looking for this solution for a week!! thanks!

    • @BetterSheets
      @BetterSheets  5 หลายเดือนก่อน

      Glad to be helpful! Anything else you need help with?

  • @wesleybarnes5376
    @wesleybarnes5376 หลายเดือนก่อน +1

    Nice! I used this with apple shortcuts

  • @chrisder1814
    @chrisder1814 หลายเดือนก่อน +1

    Hello, I have a product catalog on Google sheet that I loaded into eBay, but I would also like to load it into other marketplaces, can I use APIs to synchronize

    • @BetterSheets
      @BetterSheets  หลายเดือนก่อน

      Yes if those apis are accessible
      Maybe need to change data structure. Every api is different.

    • @chrisder1814
      @chrisder1814 หลายเดือนก่อน

      @BetterSheets APIs of what, marketplaces? Could you tell me step by step how to do it or could you recommend some tutorials to read?

  • @polgomezroyo5233
    @polgomezroyo5233 9 หลายเดือนก่อน +1

    This is amazing!! Thanks a lot for the very clear explanation!

    • @polgomezroyo5233
      @polgomezroyo5233 9 หลายเดือนก่อน

      Is there anything I should change to make it work with the keys being defined in the API Call body? I'm such a noob with this lmao

    • @BetterSheets
      @BetterSheets  2 หลายเดือนก่อน

      I wish I had more information to help you out.

    • @BetterSheets
      @BetterSheets  2 หลายเดือนก่อน

      fantastic

  • @showkothasanRaha
    @showkothasanRaha หลายเดือนก่อน

    That was great 😍

  • @macreations0528
    @macreations0528 6 หลายเดือนก่อน +1

    When i calling from Postman works fine but same api calling from my current local web project throwing error as CORS issue.

    • @BetterSheets
      @BetterSheets  6 หลายเดือนก่อน

      Not sure what you mean by local web project. Perhaps an issue with headers or GET/ POST.

    • @macreations0528
      @macreations0528 6 หลายเดือนก่อน

      @@BetterSheets i mean calling with using axios.

  • @lavilimp
    @lavilimp 8 หลายเดือนก่อน

    I love this! Thank you so much for giving me a cool idea to utilize for my projects going forward!

    • @BetterSheets
      @BetterSheets  7 หลายเดือนก่อน

      glad it was helpful!

  • @markksantos
    @markksantos หลายเดือนก่อน

    I really need help with a Apps Script I made. I need a pro to debug it. Anyone up for the challenge?

    • @BetterSheets
      @BetterSheets  29 วันที่ผ่านมา

      Become a member at bettersheets and you can email me anytime.

    • @markksantos
      @markksantos 29 วันที่ผ่านมา

      @@BetterSheets i'll need more than just an email

    • @BetterSheets
      @BetterSheets  29 วันที่ผ่านมา

      @@markksantos email any number of times. and I offer consulting too.

  • @wanderlust0120
    @wanderlust0120 4 หลายเดือนก่อน +1

    Hey nice video! But if they decide to repeal some of these features? Cause they have done it before with the Google docs API

  • @paywanddelshad7722
    @paywanddelshad7722 4 หลายเดือนก่อน +1

    Man you just made the hell out of the google sheets

    • @BetterSheets
      @BetterSheets  4 หลายเดือนก่อน

      Is that a good thing?

    • @paywanddelshad7722
      @paywanddelshad7722 4 หลายเดือนก่อน

      @@BetterSheets yes absolutely this is the best tutorial I have seen regarding this subject well thanks man keep it up and God bless you.

  • @baldyardigan
    @baldyardigan 8 หลายเดือนก่อน +2

    When I create an API with this and send a request from my next.js app, I get a CORS issue. Have you encountered or solved this?

    • @BetterSheets
      @BetterSheets  7 หลายเดือนก่อน

      Havent seen this yet.

    • @felixobianozie3745
      @felixobianozie3745 5 หลายเดือนก่อน

      Are you sending the requests using fetch, axios, or what? Maybe a few tweaks in your configuration might help if you can share. But take the following into consideration: content type should be plain text and increase your default timeout if you are waiting for async responses else you will suffer response timeout problems too.

    • @radovankrizalkovic9084
      @radovankrizalkovic9084 2 หลายเดือนก่อน

      CORS issue is sometimes misleading - could be any server error, depending on your setup. Try find where the error actually happens

  • @corneduring9730
    @corneduring9730 8 หลายเดือนก่อน +1

    My POST function works when testing it with postman, but I get CORS errors when implementing it with my react application. How do I fix this?!

    • @BetterSheets
      @BetterSheets  8 หลายเดือนก่อน

      React app? So not google sheets?

    • @dhimahi8949
      @dhimahi8949 8 หลายเดือนก่อน

      I guess the OP is making the call to the post endpoint from the react app while trying to read/write to the google sheets.

    • @dhimahi8949
      @dhimahi8949 8 หลายเดือนก่อน +1

      What workef fot me is setting the content type to be text/plain; charset=utf-8

  • @iamGobinda
    @iamGobinda 4 หลายเดือนก่อน +1

    Is it safe to use this? Is there any way to secure the APIs?

    • @BetterSheets
      @BetterSheets  4 หลายเดือนก่อน +1

      Yes. You can secure it as much as you want.

  • @rahul_bali
    @rahul_bali 4 หลายเดือนก่อน +1

    that's really cool... can we do this with json data ?

  • @AlaskaFuture
    @AlaskaFuture 8 หลายเดือนก่อน +1

    Halo,
    why di Rest API cannot fetch in PHP
    something wrong or this cannot use in PHP?

    • @BetterSheets
      @BetterSheets  8 หลายเดือนก่อน

      Cannot use PHP

    • @AlaskaFuture
      @AlaskaFuture 8 หลายเดือนก่อน

      @@BetterSheets it's work and have tried, now i can use in PHP, Thankyou

  • @tig4rx
    @tig4rx 6 หลายเดือนก่อน

    Does each post/get request counts as one Google Sheets API request? And is possible to use Bearer token to prevent anyone with the link to just be able to manipulate the data?

    • @BetterSheets
      @BetterSheets  6 หลายเดือนก่อน

      You can set up a token system yes.

    • @tig4rx
      @tig4rx 6 หลายเดือนก่อน

      @@BetterSheets Awesome, do you know if each post/get request counts as one Google Sheets API request? Or they aren't sharing the quota?

    • @BetterSheets
      @BetterSheets  6 หลายเดือนก่อน

      @@tig4rx don't think they are sharing the quota.

  • @arienugraha7554
    @arienugraha7554 5 หลายเดือนก่อน

    Cool stuff!
    Is it possible to make an online form using this method. (if I'dont want to use GForm)
    how's the performance if the concurrent hit reach 10k per minute.

    • @BetterSheets
      @BetterSheets  5 หลายเดือนก่อน

      Yes you can. I dont think its great at so many calls at once.

  • @cgc2300
    @cgc2300 8 หลายเดือนก่อน +1

    hello I'm creating a new message because I just noticed that the replies to my first message are all deleted I think TH-cam deletes them automatically otherwise I wanted to ask you if you use the APIs ? If so then I don't know at all how to do it and I wanted to ask you if the ideas I had are feasible and how I could make them come true

    • @BetterSheets
      @BetterSheets  8 หลายเดือนก่อน

      Which api?

    • @cgc2300
      @cgc2300 8 หลายเดือนก่อน

      @BetterSheets to start I would have liked to read examples to understand what I can do by connecting 2 APIs that of Google sheet and Google drag for example, what result could I obtain
      then I would like to understand what I could do if I connect Google sheet with the chatgpt API when I create a custom GPT
      and finally I would like to know the other way to use the GPT chat API, in The Playground, as a gpt agent, what result I could obtain if I connect it with different applications including that of Google sheets

    • @cgc2300
      @cgc2300 8 หลายเดือนก่อน

      @@BetterSheets To summarize, do you know if there is a site on which I could read examples, use cases, so that I can understand how to use the database function and the API function, so that I can understand why to use these two functions?
      The tutorials give me the theory but don't explain it to me concretely

  • @alfredoramirez8336
    @alfredoramirez8336 7 หลายเดือนก่อน +1

    WOOOW your genius! excellent tutorial... may i invite you a cofee on patreon or anything similar? excellent tutorial!

    • @BetterSheets
      @BetterSheets  7 หลายเดือนก่อน

      Become a member of better sheets. More awaits inside!

  • @carmenskelton
    @carmenskelton 2 หลายเดือนก่อน

    wowowowow

    • @BetterSheets
      @BetterSheets  2 หลายเดือนก่อน

      Glad you enjoyed

  • @Gainmackain1
    @Gainmackain1 7 หลายเดือนก่อน +4

    You can update your current deployment to the latest version. No need to redeploy every time.

    • @BetterSheets
      @BetterSheets  6 หลายเดือนก่อน

      Thanks for the reminder!

  • @cgc2300
    @cgc2300 7 หลายเดือนก่อน +1

    hello I made a product catalog on Google sheet then I brought this catalog into WordPress
    I was wondering if it would be possible thanks to the combination of Google Sheet APIs, WordPress and the use of n8n software
    during the sequence that we are going to see and how many times would it be possible for all the keywords present in the description column of each of the products to be automatically replaced by good keywords?
    and the same with the images

    • @BetterSheets
      @BetterSheets  7 หลายเดือนก่อน

      Anything is possible

  • @cgc2300
    @cgc2300 8 หลายเดือนก่อน

    hello

    • @BetterSheets
      @BetterSheets  8 หลายเดือนก่อน

      Hi

    • @cgc2300
      @cgc2300 8 หลายเดือนก่อน

      could I write to you, the problem is that I am French and the translators are very bad and I thought that gpt could translate better but it is also bad

    • @BetterSheets
      @BetterSheets  7 หลายเดือนก่อน

      @@cgc2300 members can email me anytime.