App Logo

Official scripts

Explore our curated collection of scripts

mail.google.com

Reply to Gmail thread

Reply (or reply-all) in a Gmail thread by its hex threadId (as returned by search_emails), with a plain-text body. Replies to the latest message of the thread. Returns sent, threadId, replyAll.

mail.google.com

Search Gmail

Search the signed-in Gmail with the native query syntax (from:, to:, subject:, has:attachment, after:/before:, labels…) and return matching threads: threadId (feed it to get_thread / reply_to_email), sender, senderEmail, subject, snippet, date, unread, starred, hasAttachment. Results are threads rather than individual messages, which is Gmail's own search granularity, and only the first page of results is returned (up to 50).

mail.google.com

List Gmail inbox

List the messages on the first page of the Gmail inbox. Requires an authenticated mail.google.com session. Returns folder, total (the range line as rendered, e.g. "1–50 of 240") and rows of sender, subject, snippet, date plus the unread / starred / hasAttachment flags. Covers only the first inbox page (up to ~50 rows as Gmail renders it); there is no pagination. Be aware that the output requires at least one row, so a genuinely empty inbox is not representable and will surface as a failure rather than an empty list.

mail.google.com

Trash Gmail thread

Move a Gmail thread to the Bin by its hex threadId. Acts from the list view, scanning the first 4 All Mail pages (~200 newest threads), and confirms the row actually left All Mail rather than trusting a toast. Returns trashed, threadId, and the page it was found on.

mail.google.com

Send Gmail email

Send an email from the signed-in Gmail account, with a plain-text body and an optional single file attachment.

mail.google.com

Get Gmail thread

Read a Gmail thread by its hex threadId (as returned by search_emails): subject plus every rendered message's from, fromEmail, to, date, plain-text body and attachment names. In long threads Gmail collapses older messages, so only rendered (expanded) messages are returned.

mail.google.com

Create a Gmail draft

Compose a Gmail message and save it as a draft without sending it. Takes to/cc/bcc, subject and body, and confirms the draft exists in Drafts afterward rather than trusting the compose window closing.

mail.google.com

Forward Gmail thread

Forward an entire Gmail thread to one recipient, with an optional leading note. Takes the hex threadId that search_emails returns, and forwards the whole conversation inline rather than a single message. Returns forwarded, threadId and to. The thread must be on the first page of All Mail, newest-first, so older conversations cannot be reached this way.

mail.google.com

List Gmail labels / folders

List the Gmail labels and system folders visible to the account, with their unread counts where Gmail shows one. Distinguishes system folders (Inbox, Sent, Drafts, Spam, Bin...) from user-created labels.

mail.google.com

Mark Gmail thread as unread

Mark a Gmail thread as unread by its hex threadId. Returns unread, threadId, the All Mail page it was found on, and already_unread. Acts from the All Mail list, scanning the first 4 pages (~200 newest threads). Safe to repeat: a thread that is already unread returns already_unread:true without clicking anything. Waits for Gmail to persist the change rather than returning on the optimistic row restyling, so the mail really is unread once the run ends.

mail.google.com

Mark Gmail thread as read

Mark a Gmail thread as read by its hex threadId. Returns read, threadId, the All Mail page it was found on, and already_read. Acts from the All Mail list, scanning the first 4 pages (~200 newest threads). Safe to repeat: a thread that is already read returns already_read:true without clicking anything. Waits for Gmail to persist the change rather than returning on the optimistic row restyling, so the mail really is read once the run ends.

mail.google.com

Send a Gmail draft

Send an existing Gmail draft, identified by the id the drafts listing gives you. This delivers a real message and cannot be undone, so the draft's recipients and subject are read and reported back before and with the send, and a draft with no recipient is refused rather than attempted. Success is confirmed two ways: the draft leaves Drafts and the same conversation turns up in Sent. The conversation id is returned and is the same before and after sending, so the message can be found again afterwards.

mail.google.com

List Gmail drafts

List the unsent drafts in the signed-in Gmail account, each with the identifier needed to open, edit or send it, plus its subject, preview text, whether it carries an attachment, and the date Gmail shows. Gmail's own draft total is returned alongside the number of drafts read, so a mailbox with more drafts than one screenful is visible as such rather than looking complete. An account with no drafts is a normal empty result, not an error. Note that the drafts list does not show who a draft is addressed to — Gmail puts the word "Draft" where the recipient would be — so recipients have to come from opening the draft itself.

mail.google.com

unsubscribe_from_sender

Unsubscribe from a mailing list using Gmail's own unsubscribe control, which appears beside the sender on a message carrying a List-Unsubscribe header. Returns the sender it acted on, whether the control was present, and whether Gmail confirmed the request. This leaves the mailing list for real and cannot be undone from Gmail: confirm the exact sender with the user before running, and note that approval for one sender does not carry over to another. Senders with no unsubscribe control are reported rather than acted on, and the script never falls back to reporting spam.

mail.google.com

Archive Gmail thread

Archive a Gmail thread by its hex threadId (removes it from the Inbox; it stays in All Mail). Returns archived, threadId, and the Inbox page it was found on. Acts on the thread's row in the Inbox list, scanning the first 4 Inbox pages (~200 newest threads), and confirms the row actually left the list rather than trusting a toast. If the thread is not in those pages it throws: it is then already archived (nothing to do) or older than that. It never acts from the conversation view, where Gmail's Archive control is offered whatever the thread's state and so cannot confirm anything.

mail.google.com

Report Gmail thread as spam

Report a Gmail thread as spam by its hex threadId (moves it to Spam). Requires an authenticated mail.google.com session. Works from the All Mail list view, scanning the first 4 pages (~200 newest threads), and is locale-independent. Returns reportedSpam, threadId, and the page it was found on. Moving the thread to Spam also feeds Gmail's spam classifier for that sender, which undoing does not fully reverse. Pass `account` (authuser=) in a multi-account browser jar, or Gmail picks u/0 nondeterministically. Senders with an unsubscribe link raise an extra "Report spam or unsubscribe?" dialog; the script confirms the spam branch and rejects the unsubscribe one, and throws rather than guessing on an unrecognised dialog shape.

mail.google.com

Gmail — Apply or remove a label on a thread

Apply a label to a Gmail thread by its hex threadId, optionally creating the label first, or take the label off again with remove:true. A thread already in the requested state is reported as a no-op without clicking. Takes a received thread — Gmail renders no conversation heading for a thread you sent to yourself, so those are refused rather than risk labelling the wrong thread.

mail.google.com

Update a Gmail draft

Change the subject and/or body of an existing Gmail draft, identified by the id the drafts listing gives you. Whichever field you leave out keeps its current value; a field you pass replaces what was there rather than appending to it. The draft's current contents are read first, so asking for what it already says makes no change and says so. Gmail issues a draft a new id every time it is saved, so the id you passed in stops existing and the new one is returned — use that for any follow-up. The conversation id stays the same and is returned as the stable handle. Recipients are not touched by this script.

google.com

Create a Google Workspace user (Admin console)

Creates a new user in the Google Admin console (Workspace) under the domain of the given admin account: fills first/last name, primary email local-part, optional secondary (personal) email, submits with an auto-generated 16-char password, and optionally sends the native "set your password" login-instructions email to the secondary address. Returns the created email and generated password. The admin account must already be signed in to this browser, with a session recent enough that Google does not ask to confirm the password again — when it does, the script stops before touching anything and tells you to sign in once by hand.

play.google.com

Get Google Play app details

Fetch an Android app's store listing details: name, description, developer, category, rating, review count, price, and icon. No login required.

google.com

Search Google Maps places

Search Google Maps for places matching a query, optionally near a location. Returns n, captured, and records with name, address, phone, website, rating, category, lat, lng, placeId, and placeUrl. placeId is the join key for get_place and get_place_reviews; rating, category, lat and lng can be null.

play.google.com

Search Google Play apps

Search the Google Play Store for apps by keyword: package id, name, developer, rating, and icon for each result. No login required.

google.com

Get Google Maps place details

Get one Google Maps place/business details by placeId (canonical ChIJ... from search_places), place URL, or free-text name+location. Returns name, fullAddress, phone, website, instagram, category, rating, reviews, hours, plusCode, lat, lng, placeId, placeUrl, resolvedUrl, matched, elapsed_s. matched is false when it did not resolve; the free-text path falls back to the first search result, so it can resolve the wrong place. Business fields (rating/reviews/hours/category/lat/lng/plusCode) are null when the place does not expose them.

google.com

Get Google Maps place reviews

Get a Google Maps place's reviews by placeId. Returns n and reviews with author, authorMeta byline, rating, time, text, and reviewId. Returned in Google's default "most relevant" order, not by date; fewer than requested come back for places with few reviews.

google.com

Maps: Search Businesses

Search for businesses on Google Maps (anonymous, no login): name, category, address, phone, website, rating, reviews, GPS, place_id. Paginates via scrolling, controlled by the count argument.