{"id":4875,"date":"2026-03-30T09:40:07","date_gmt":"2026-03-30T09:40:07","guid":{"rendered":"https:\/\/tinyurl.com\/blog\/?p=4875"},"modified":"2026-04-07T15:53:05","modified_gmt":"2026-04-07T15:53:05","slug":"create-tinyurl-links-google-sheets","status":"publish","type":"post","link":"https:\/\/tinyurl.com\/blog\/create-tinyurl-links-google-sheets\/","title":{"rendered":"How Can I Create TinyURL Links using Google Sheets?"},"content":{"rendered":"\n<p style=\"font-size:16px\">You can integrate the TinyURL API with Google Sheets using Apps Script and an API token. Follow these instructions to set it up:<\/p>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol class=\"wp-block-list\">\n<li style=\"font-size:16px\">Register and set up your account: Create a TinyURL account if you don&#8217;t have one. Then, generate an API token with &#8220;Create TinyURL&#8221; permissions and store it in a secure location.<\/li>\n<\/ol>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol start=\"2\" class=\"wp-block-list\">\n<li style=\"font-size:16px\">Open your Google Sheet: Navigate to the Google Sheet where you want to generate TinyURLs from destination URLs.<\/li>\n<\/ol>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li style=\"font-size:16px\">Access Apps Script: Go to Extensions > Apps Script. A new window will open.<\/li>\n<\/ol>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol start=\"4\" class=\"wp-block-list\">\n<li style=\"font-size:16px\">Add the script: Copy the provided script into the editor window. On line 3, replace\u00a0<code>yourTokenValue<\/code>\u00a0with the API token from step 1 (e.g.,\u00a0<code>var token = \"abc123yourActualToken\";<\/code>).<\/li>\n<\/ol>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol start=\"5\" class=\"wp-block-list\">\n<li style=\"font-size:16px\">Prepare your data: Enter a destination URL in a cell, such as J6.<\/li>\n<\/ol>\n\n\n\n<div style=\"height:16px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<ol start=\"6\" class=\"wp-block-list\">\n<li style=\"font-size:16px\">Generate TinyURLs: In another cell (e.g., K6), enter the formula\u00a0<code>=shortenUrl(J6)<\/code>\u00a0to automatically create a TinyURL. Drag the formula down to apply it to additional URLs.<\/li>\n<\/ol>\n\n\n\n<div style=\"height:25px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code>function shortenUrl(longUrl) {\n  var apiUrl = \"https:\/\/api.tinyurl.com\/create\";\n  var token = \"yourTokenValue\"; \/\/ replace with your real token\n\n  var payload = {\n    \"url\": longUrl\n  };\n\n  var options = {\n    method: \"post\",\n    headers: {\n      \"Authorization\": \"Bearer \" + token,\n      \"Accept\": \"application\/json\",\n      \"Content-Type\": \"application\/json\"\n    },\n    payload: JSON.stringify(payload),\n    muteHttpExceptions: true\n  };\n\n  var response = UrlFetchApp.fetch(apiUrl, options);\n  var json = JSON.parse(response.getContentText());\n\n  \/\/ TinyURL API returns { data: { tiny_url: \"...\" } }\n  if (json.data &amp;&amp; json.data.tiny_url) {\n    return json.data.tiny_url;\n  } else {\n    return \"Error: \" + response.getContentText();\n  }\n}<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can integrate the TinyURL API with Google Sheets using Apps Script and an API token. Follow these instructions to set it up:<\/p>\n","protected":false},"author":4,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[60],"tags":[67],"class_list":["post-4875","post","type-post","status-publish","format-standard","hentry","category-help","tag-api-help"],"_links":{"self":[{"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/posts\/4875","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/comments?post=4875"}],"version-history":[{"count":2,"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/posts\/4875\/revisions"}],"predecessor-version":[{"id":4878,"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/posts\/4875\/revisions\/4878"}],"wp:attachment":[{"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/media?parent=4875"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/categories?post=4875"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tinyurl.com\/blog\/wp-json\/wp\/v2\/tags?post=4875"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}