Your Drive has spreadsheets scattered across projects — budget trackers, meeting notes, expense logs. You want just their names in a Python list. How do you start?
Same pattern as tasks? Call a search action, grab a list under some key, pull the name off each with a comprehension?
Exactly. The action is GOOGLESHEETS_SEARCH_SPREADSHEETS and the response shape is {"spreadsheets": [...]} where each entry has a name. Note the new list key — it's not items, it's the API's own word:
result = toolset.execute_action(Action.GOOGLESHEETS_SEARCH_SPREADSHEETS, {})
files = result.get("spreadsheets", [])Another new list key — spreadsheets instead of items. Do I have to look that up every time I learn a new API?
Once per API. Every API picks the word that reads best in its own context. The defensive .get(key, []) pattern doesn't care — you just swap the string inside the call:
def list_spreadsheet_names() -> list:
result = toolset.execute_action(Action.GOOGLESHEETS_SEARCH_SPREADSHEETS, {})
files = result.get("spreadsheets", [])
return [f.get("name", "") for f in files]Sheets uses name for the title, but Calendar used summary and Tasks used title. Same concept, three different words?
Each API reflects the language of its domain — calendar events have a summary, tasks have a title, spreadsheets have a name. You learn the vocabulary once per API and the Python skeleton stays constant.
So across three APIs, three list keys and three title field names — but literally one calling pattern?
That is the payoff of this track. The shape of your code is stable. Only the strings change.
TL;DR: Every API picks its own list key and its own title field — the defensive .get() pattern handles all of them.
Action.GOOGLESHEETS_SEARCH_SPREADSHEETSspreadsheetsname| API | List key | Title field |
|---|---|---|
| Gmail | messages | snippet |
| Calendar | items | summary |
| Tasks | items | title |
| Sheets | spreadsheets | name |
Create a free account to get started. Paid plans unlock all tracks.
Your Drive has spreadsheets scattered across projects — budget trackers, meeting notes, expense logs. You want just their names in a Python list. How do you start?
Same pattern as tasks? Call a search action, grab a list under some key, pull the name off each with a comprehension?
Exactly. The action is GOOGLESHEETS_SEARCH_SPREADSHEETS and the response shape is {"spreadsheets": [...]} where each entry has a name. Note the new list key — it's not items, it's the API's own word:
result = toolset.execute_action(Action.GOOGLESHEETS_SEARCH_SPREADSHEETS, {})
files = result.get("spreadsheets", [])Another new list key — spreadsheets instead of items. Do I have to look that up every time I learn a new API?
Once per API. Every API picks the word that reads best in its own context. The defensive .get(key, []) pattern doesn't care — you just swap the string inside the call:
def list_spreadsheet_names() -> list:
result = toolset.execute_action(Action.GOOGLESHEETS_SEARCH_SPREADSHEETS, {})
files = result.get("spreadsheets", [])
return [f.get("name", "") for f in files]Sheets uses name for the title, but Calendar used summary and Tasks used title. Same concept, three different words?
Each API reflects the language of its domain — calendar events have a summary, tasks have a title, spreadsheets have a name. You learn the vocabulary once per API and the Python skeleton stays constant.
So across three APIs, three list keys and three title field names — but literally one calling pattern?
That is the payoff of this track. The shape of your code is stable. Only the strings change.
TL;DR: Every API picks its own list key and its own title field — the defensive .get() pattern handles all of them.
Action.GOOGLESHEETS_SEARCH_SPREADSHEETSspreadsheetsname| API | List key | Title field |
|---|---|---|
| Gmail | messages | snippet |
| Calendar | items | summary |
| Tasks | items | title |
| Sheets | spreadsheets | name |