Get Full Year API with Google Sheets

Learn how to turn a Google Sheet into a full-year API that automatically updates, allowing you to share specific data with others securely. This tutorial covers the steps to create and deploy a web app using Google Apps Script.

Super simple video here. We're going to take a Google sheet and turn it into an API for the full year so we can type in the year 2026 right here and we can give access to people to get this number , but we wanna update it all the time. So we're gonna use year and we're gonna wrap today inside of year. Now what's gonna happen is this is just automatic every single year. This is going to change, and you can do this for a day. You can do this for any piece of information. We'll put it in a one here on the sheet called Year in all caps. Then we're gonna go up to extensions, go to app script , click okay, let's name this. Get full year. Now the function has to be exactly do capital GET do get,

and we're gonna put an E here. This E is actually gonna be a URL. Actually, I'll, I'll make that A URL. It could be any kind of variable here. Basically, we're going to be able to get a parameter from this if we need something like a password equals URL dot. Parameter password. And now again, this password and this variable password are just words, letters that we choose, and I'll show you how that works later when we get the URL to give people access to our API. If we want to give them a password. If password is equal to 1, 2, 3, 1, 2, 3, then we'll return. We do content service, create text output, and here we'll get the year, which is variable year equals spreadsheet app.

Do get active spreadsheet , get sheet by name, put in the capital YER, get range A one. Get value. So we're getting the value from a one on the tab year in the spreadsheet that we have right now. We're gonna save all of this and we're gonna go up to the top right and click deploy. Deploy new deployment. We'll select the type As web app. I'm gonna execute it as me and who has access ? Anyone deploy. Waiting, waiting, waiting. We do need to authorize it. Hit continue. And now we have a URL. I'm gonna click done and I'm gonna save this URL up above this function . URL equals in quotes this. Now, this URL, if I use it in an incognito tab, 'cause I'm logged into Google, you can use this URL as is somewhere else, and you can

share this with other, other people. But because I'm logged in into Google right now, I have to use an incognito window and I need to add the parameter of password in this particular case. So I'm gonna. Add at the end question mark. Password equals 1, 2, 3, and we get 2026, so we're getting the text back exactly. As we have it in our sheet, this is pretty cool right now, if we don't want a password, if we're like, Hey, I just want to execute that URL, I don't want a password for my API. I just have to delete this password stuff. Delete that. Delete this second curly brackets. Save. Now I'm gonna redeploy. I want to use the exact same URL. I'm gonna go to deploy managed deployments. It's like I've edited something, but I don't wanna switch out the URLs.

I just click on that pencil icon in the top right. Instead of version one, I go New version. I could add a description here. This is just gonna gimme a little rundown here on the left. I don't need to deploy is the next step. Wait, wait, wait. And now again, we have exactly the same web app, URL. Don't copy this library one, but this. Web app URL is exactly the same. And now I can go in incognito window, paste it, and there it is, 2026. So now I have given access to my Google sheet to anyone with this URL, but they don't have edit access . They don't have view access , they don't have any other access other than what I give them through this function . Do get, this is pretty cool and I hope you enjoyed getting the full year as an API inside of a Google sheet. You are watching better sheets here on YouTube.

Make sure you check out this video or this video and subscribe right now to get more tips, tricks, how tos, get more out of your Google sheets than you ever have before. I'm excited to be making a ton more videos here. Ask me questions down in the comments and I will answer them in future videos. But for right now, right here, one of these videos is gonna be your next Google sheet.