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

Sends an HTTP request to a URL and returns the response.

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.

Explore

Related methods

3 Better Sheets tutorials

Access Free API's with Google Sheets

Access Free API's with Google Sheets

Get Kanye Quotes, Hogwarts Houses, Public Holidays, and more fun with AP...
Access the Dictionary API to get Definitions for Words in Google Sheets

Access the Dictionary API to get Definitions for Words in Google Sheets

Automatic Screenshots in Apps Script

Automatic Screenshots in Apps Script

Related blog posts

Written guides about UrlFetchApp.fetch().

Browse the blog