Reads the response body as text.
class UrlFetchApp method .getContentText()
UrlFetchApp is the Apps Script service.
.getContentText() is the method name you will see after a dot in your code.
What it does
Why it's used
- Read JSON or plain text from an API response.
- Parse the body after fetch returns.
Common errors
- Forgetting parentheses on getContentText. Write UrlFetchApp.getContentText(), not UrlFetchApp.getContentText or getContentText by itself.
- Skipping dots between chained calls. Each step needs a dot, like UrlFetchApp.getContentText().
- Adding spaces where they do not belong. Write UrlFetchApp.getContentText(), not UrlFetchApp .getContentText(), UrlFetchApp.getContentText (), or UrlFetchApp . getContentText().
- Wrong capitalization. Use UrlFetchApp and getContentText, not urlfetchapp or getcontenttext.
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
- 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
- Google Maps Scraper for Outreach
- How to Create AI Images From Google Sheets
Explore
Related methods
-
.fetch()
Sends an HTTP request to a URL and returns the response.
-
.getHeaders()
Returns the HTTP headers from a response.
-
.getResponseCode()
Returns the HTTP status code from a response.
-
.fetchAll()
Sends multiple HTTP requests in parallel.
More Apps Script
Better Sheets tutorials
Access Free API's with 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 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
Related blog posts
Written guides about UrlFetchApp.getContentText().