recipe-search-and-export-emails

Search Gmail messages by query and export results for offline review. Requires the gws-gmail skill as a prerequisite dependency Supports Gmail query syntax for filtering by sender, date, labels, and other message properties Exports search results to JSON format for further processing or archival Retrieves full message details including headers and body content for selected emails

INSTALLATION
npx skills add https://github.com/googleworkspace/cli --skill recipe-search-and-export-emails
Run in your project or agent environment. Adjust flags if your CLI version differs.

SKILL.md

Search and Export Emails

PREREQUISITE: Load the following skills to execute this recipe: gws-gmail

Find Gmail messages matching a query and export them for review.

Steps

  • Search for emails: gws gmail users messages list --params '{"userId": "me", "q": "from:client@example.com after:2024/01/01"}'
  • Get full message: gws gmail users messages get --params '{"userId": "me", "id": "MSG_ID"}'
  • Export results: gws gmail users messages list --params '{"userId": "me", "q": "label:project-x"}' --format json > project-emails.json
BrowserAct

Let your agent run on any real-world website

Bypass CAPTCHA & anti-bot for free. Start local, scale to cloud.

Explore BrowserAct Skills →

Stop writing automation&scrapers

Install the CLI. Run your first Skill in 30 seconds. Scale when you're ready.

Start free
free · no credit card