Sends an HTTP request to a URL and returns the response.
class UrlFetchApp method .fetch()
UrlFetchApp is the Apps Script service.
.fetch() is the method name you will see after a dot in your code.
What it does
Why it's used
- Call Stripe, Slack, or any REST API from a sheet button.
- Post sheet rows to a webhook when something changes.
Common errors
- Forgetting parentheses on fetch. Write UrlFetchApp.fetch(), not UrlFetchApp.fetch or fetch by itself.
- Skipping dots between chained calls. Each step needs a dot, like UrlFetchApp.fetch().
- Adding spaces where they do not belong. Write UrlFetchApp.fetch(), not UrlFetchApp .fetch(), UrlFetchApp.fetch (), or UrlFetchApp . fetch().
- Wrong capitalization. Use UrlFetchApp and fetch, not urlfetchapp or fetch.
Snippets using this method
- Use Random Quote API in Google Sheets
- Ultimate Prompt Writer and Prompt Rater
- Ultimate Headline Writer with GPT in SHEETS
- Upgrade Google Sheets OpenAI Prompt to GPT 4
- Visicalc 2023 Design Walkthrough
- Visicalc 2023 Quick Walkthrough
- Tweet From a Sheet
- Take Screenshots from URLs in Google Sheets
- Spreadsheet Automation for Beginners
- Shaman: AI Blog Writer
- Shaman: AI Blog Writer
- Scrape Google Maps Added Phone and Reviews
- Perfect Use of AI in Google Sheets (Categorize Tasks)
- Run 100 ChatGPTs at One Time
- Saving OpenAI API Calls inside of Google Sheets
- Prompt Parade
- Quickstart Tutorial OpenAI API in Google Sheets
- Make AI-generated Poems Based on Name
- OpenAI API Prompt with Array of Cells
- I Built a SEO Meta Description Writer
- One Weird Google Sheet Formula for Bulk Publishing With AI
- Mr. Beast Renamed My YouTube Titles
- Learn to Code in Google Sheets, For Programmers
- How to Validate Email Addresses
Explore
Related methods
-
.fetchAll()
Sends multiple HTTP requests in parallel.
-
.getHeaders()
Returns the HTTP headers from a response.
-
.getResponseCode()
Returns the HTTP status code from a response.
-
.getContentText()
Reads the response body as text.
More Apps Script
Better Sheets tutorials
Access Free API's with Google Sheets
Access the Dictionary API to get Definitions for Words in Google Sheets
Automatic Screenshots in Apps Script
Build a Book Recommender with AI in Google Sheets
Build a Startup Pitch Generator in 20 minutes
Building an AI Prompts Playground
Build Your Own AI Writer in Google Sheets
Build Your Own Free Domain Availability Checker
ChatGPT Clone in Google Sheets Part 1
ChatGPT Clone in Google Sheets Part 2
Create a ChatGPT Cheat Sheet Spreadsheet
Create a Waterfall of AI Prompts and Responses
Created a GPT function in Sheets
Daily Writer's Word Count Tracker
Fast FAQS
Google Maps Scraper for Outreach
How to Create AI Images From Google Sheets
How To Download All Tabs as CSV in a Zip File
How to Validate Email Addresses
Learn to Code in Google Sheets, For Programmers
Make AI-generated Poems Based on Name
One Weird Google Sheet Formula for Bulk Publishing With AI
OpenAI API Prompt with Array of Cells
Perfect Use of AI in Google Sheets (Categorize Tasks)
Prompt Parade
Quickstart Tutorial OpenAI API in Google Sheets
Run 100 ChatGPTs at One Time
Saving OpenAI API Calls inside of Google Sheets
Scrape Google Maps
Scrape Google Maps Added Phone and Reviews
Shaman: AI Blog Writer
Take Screenshots from URLs in Google Sheets
Tweet From a Sheet
Ultimate Prompt Writer and Prompt Rater
Use Random Quote API in Google Sheets
Visicalc 2023 Design Walkthrough
Related blog posts
Written guides about UrlFetchApp.fetch().