Make an API With Google Sheets and Google Apps Script

แชร์
ฝัง
  • เผยแพร่เมื่อ 26 ก.ย. 2020
  • In this video, we'll be making our own DIY API using Google Sheets and Google Apps Script. This is an easy way to make your own database without a backend server.
    The link to my example API:
    rb.gy/mxwbdw
    An example search using my API:
    rb.gy/mxwbdw?q=JK%20Rowling
    The link to a website I made using this technique:
    listenr.gq/
    The link to my website:
    cukmekerb.github.io/

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

  • @kevalsanghvi3045
    @kevalsanghvi3045 2 ปีที่แล้ว +10

    Excellent video. It was very useful. Every other video on this topic showed this by third party websites and requests are very limited. And no one other then you showed this without using such websites and also explained the whole code beautifully. Thank You for sharing your knowledge. Keep making such informative videos.

  • @mimocrocodile5069
    @mimocrocodile5069 ปีที่แล้ว

    Perfect. Just in time i found this video

  • @cesarantunes4004
    @cesarantunes4004 ปีที่แล้ว

    Excellent, it works perfect for me, thank you very much!

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

    Coming late to this video but appreciate the walk through! Is there a way to include the column header info as tags for each row of data? Or do you have another video where you get into how to do that?

  • @maximilianogabrielfranchve7367
    @maximilianogabrielfranchve7367 ปีที่แล้ว

    Hi! Awesome video. That's what I was looking for. I was wondering if you could make a video for POST request, as I need to send information from a chatbot to google sheet.

  • @alexanderbelikov9876
    @alexanderbelikov9876 3 ปีที่แล้ว

    Hi!) Thank you for video!
    Could you be so kind to advice - how to run google script from php? Thank you

  • @videosforyou4228
    @videosforyou4228 2 ปีที่แล้ว

    Is it possible to use the post request from Airtable and populate that website data into google sheets?

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

    Perfect ! It's working...

  • @cristcaballero
    @cristcaballero ปีที่แล้ว

    perfect , thanks

  • @ssj7gokurpg
    @ssj7gokurpg 2 ปีที่แล้ว

    Excellent.

  • @peterberumen854
    @peterberumen854 2 ปีที่แล้ว +1

    I see so many people with the same issue but not solution!
    TypeError: Cannot read property 'parameter' of undefined (line 2, file "Code")
    Whats the fix??

  • @BrodieTheAthlete
    @BrodieTheAthlete 2 ปีที่แล้ว +1

    do you have the source code any where?

  • @josepalomarespalacios
    @josepalomarespalacios 3 ปีที่แล้ว +4

    ReferenceError: propertiesService is not defined (línea 5, archivo "apis") . Any help?

  • @sumitsarkar839
    @sumitsarkar839 2 ปีที่แล้ว

    Thank you :-)

  • @irpcplebsection9677
    @irpcplebsection9677 2 ปีที่แล้ว

    what is empty array in last row ?

  • @ademcihan892
    @ademcihan892 2 ปีที่แล้ว +1

    con you help me
    TypeError: Cannot read property 'parameter' of undefined (satır: 2, dosya: "Kod")

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

    Great Video.

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

    this is like playing the Gollum game but in tutorial form for developers

  • @tonmoitanvi1773
    @tonmoitanvi1773 2 ปีที่แล้ว +2

    oh, it was easy though, do you think it's better than the Sheet Best API tool? what do you think? do you have any suggestions for that?

    • @cukmekerb
      @cukmekerb  2 ปีที่แล้ว

      I haven't heard of that one before, but I have tried similar services and they have rate limits and they're really slow

  • @hamzach933
    @hamzach933 3 ปีที่แล้ว +2

    From where i can this wallpaper like your desktop wallpaper? Thanks!

    • @cukmekerb
      @cukmekerb  3 ปีที่แล้ว +1

      It was one of the builtin MacOS ones, but they got rid of it recently :(

    • @hamzach933
      @hamzach933 3 ปีที่แล้ว +1

      @@cukmekerb Version please?

    • @cukmekerb
      @cukmekerb  3 ปีที่แล้ว +2

      It’s still in mojave and maybe catalina

  • @thesumitsingh1234
    @thesumitsingh1234 2 ปีที่แล้ว

    are there any limits to using this? I mean any restrictions on the number of such requests that can be made using this method?

    • @cukmekerb
      @cukmekerb  2 ปีที่แล้ว

      there are but they're very high

  • @flexible8ark
    @flexible8ark 3 ปีที่แล้ว +1

    I followed your code, but the following message came out.
    The following script function (doGet) could not be found.
    Do you know what's wrong?

    • @cukmekerb
      @cukmekerb  3 ปีที่แล้ว +2

      try saving it and redeploying. sometimes gas doesn't recognize a save

    • @dorjeewangchuk7752
      @dorjeewangchuk7752 2 ปีที่แล้ว

      TypeError: Cannot read property 'getLastRow' of null (line 7, file "Code")

  •  2 ปีที่แล้ว +1

    Great video! I tried it but it's giving me an error. ReferenceError: sheet is not defined (line 7, file "Code") Any ideas how to fix it?

    • @Ryan-tr3gs
      @Ryan-tr3gs ปีที่แล้ว

      +1 Doesn't work

    • @Ryan-tr3gs
      @Ryan-tr3gs ปีที่แล้ว

      Did you get it to work?

  • @dorjeewangchuk7752
    @dorjeewangchuk7752 2 ปีที่แล้ว

    TypeError: Cannot read property 'getLastRow' of null (line 7, file "Code")

  • @jeremray4620
    @jeremray4620 3 ปีที่แล้ว +2

    very useful thanks a lot !! how can we have the result without double "[ "
    I mean this = {"data":["John Smith","Just some rando"],"error":false}
    instead of = {"data":[["John Smith","Just some rando"]],"error":false}
    many thanks again

    • @malliditarunreddy
      @malliditarunreddy 3 ปีที่แล้ว +1

      just create another empty list and push the present list into it and return the new list and you are done ; )

  • @yes_daily_motivation
    @yes_daily_motivation 2 ปีที่แล้ว +2

    Can we make post request too using this api?
    If yes, please tell how?

    • @cukmekerb
      @cukmekerb  2 ปีที่แล้ว

      yes, just replace doGet with doPost

  • @Mohamed-shehata-2023
    @Mohamed-shehata-2023 ปีที่แล้ว

    thanks

  • @kfl-appsheet6167
    @kfl-appsheet6167 7 หลายเดือนก่อน

    Exception: Login information disallowed: may i know reason while executing appscript

  • @watchonlinemovies2919
    @watchonlinemovies2919 3 ปีที่แล้ว +2

    TypeError: Cannot read property 'getId' of null
    code.gs:24
    24: PropertiesService.getScriptProperties().setProperty("key", doc.getId())
    i got this errer plz.help

    • @cukmekerb
      @cukmekerb  3 ปีที่แล้ว

      Doc is undefined

    • @culturauniversalTV
      @culturauniversalTV 2 ปีที่แล้ว +1

      PropertiesService.getScriptProperties().setProperty("key", doc.getId());

  • @karanjoshi12
    @karanjoshi12 3 ปีที่แล้ว +1

    Hey unknown parameter error is popping up any solution for this ?

    • @cukmekerb
      @cukmekerb  3 ปีที่แล้ว

      What exactly does the error say?

  • @hossainabeer
    @hossainabeer 2 ปีที่แล้ว

    Hi, I literally copied every code of yours without error, and after publishing it as web page, I copied the url then pasted it, and got the following message: "Exception: Cannot convert 'function () { [native code] }' to int. (line 9, file "Code")" . Note: my sheet contains only two column of data just like yours.

    • @hossainabeer
      @hossainabeer 2 ปีที่แล้ว

      and running the script, I got the message in terminal: "TypeError: Cannot read property 'parameter' of undefined"

    • @hossainabeer
      @hossainabeer 2 ปีที่แล้ว

      the code:
      function doGet(request){
      var query = request.parameter.q;
      var parameters = 2;
      var sheetname = "Sheet1";
      var doc = SpreadsheetApp.openById(PropertiesService.getScriptProperties().getProperty("key"));
      var sheet = doc.getSheetByName(sheetname);
      var lastrow = sheet.getLastRow;
      var rows = [];
      var range = sheet.getRange(2, 1, lastrow, parameters);
      var values = range.getValues();
      for(var row in values){
      rows.push([]);
      for(var col in values[row]){
      rows[row].push(values[row][col]);
      }
      }
      if(query != null){
      var rowstoreturn = rows.filter(a => a[0] == query);
      return ContentService.createTextOutput(JSON.stringify({"date":rowstoreturn, "error":false})).setMimeType(ContentService.MimeType.JSON);
      }
      return ContentService.createTextOutput(JSON.stringify({"date":rows, "error":false})).setMimeType(ContentService.MimeType.JSON);
      }
      function setup(){
      var doc = SpreadsheetApp.getActiveSpreadsheet();
      PropertiesService.getScriptProperties().setProperty("key", doc.getId());
      }

  • @avasworkshop6812
    @avasworkshop6812 3 ปีที่แล้ว +1

    I loved the JK Rowing part lol! So true! Nice video!! +1 sub
    Can you do some videos on creating desktop apps (python or java?)

    • @cukmekerb
      @cukmekerb  3 ปีที่แล้ว +1

      Hey, I just watched your animatronic tutorial, it was really cool! I don't know java, but python is a really great language that I wish I could cover more. If you have any ideas for a python video, lmk. Also, I just subscribed to your channel.

    • @KushEzio
      @KushEzio 3 ปีที่แล้ว +1

      @@cukmekerb Hi i was not able to use this link in postman.. how can i do that..?

  • @AdamBJohnson1
    @AdamBJohnson1 3 ปีที่แล้ว +4

    If anyone is looking for the Apps Script code from this video, I posted it here (plus a few additional comments): gist.github.com/adamjohnson/3d1e0d6349df8ba1ccf1e45c6d8da5d1
    Google Apps Script recently updated their UI. FWIW, I couldn't get this code to work, but I was working with different data. Curious if anyone here can get it working? Let us know in the comments below.

    • @jinshengkhoo963
      @jinshengkhoo963 ปีที่แล้ว

      Hi, sorry for being 1 year late to this. Thanks a lot for the code and I managed to get it working by running the 'setup' function first from the project editor then refresh your URL, hope that helps.

    • @Mohamed-shehata-2023
      @Mohamed-shehata-2023 ปีที่แล้ว

      thanks

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

      It's working for me.

  • @tuminspace
    @tuminspace 3 ปีที่แล้ว +4

    I get this error;
    Error TypeError: Cannot read property 'parameter' of undefined
    doGet @ Code.gs 2

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

    I don't understand all of it.

  • @TA-wn6ci
    @TA-wn6ci 2 ปีที่แล้ว

    dislike due to great JK Rowling bad mention. Glory to the honest people!