Your research task list has 15 to-dos from the last revision round. You want to build an automation that adds "Review new paper" tasks from the citation sheet. First you need the task list IDs. How do you get them?
find_events from Day 11 uses the calendar ID from list_calendars. For tasks, I'd expect a similar two-step: list the task lists first, then list the tasks inside a specific list.
Exactly right. First call GOOGLETASKS_LIST_TASK_LISTS to get your task lists — they're like notebooks, each with its own ID. Then call GOOGLETASKS_LIST_TASKS with a specific tasklist_id to get the tasks inside it:
list_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
task_lists = list_result.get("items", [])
# pick the list you want
task_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASKS, {"tasklist_id": list_id})
tasks = task_result.get("items", [])What's a task list vs a task? I thought Google Tasks just had tasks.
Google Tasks has a two-level hierarchy: task lists are like research notebooks ("Paper Review", "Admin", "Writing"), and tasks live inside lists. GOOGLETASKS_LIST_TASK_LISTS returns the notebooks; GOOGLETASKS_LIST_TASKS returns the tasks inside one notebook. You need the list ID to access the tasks.
So I find the "Paper Review" task list by its title, grab its ID, then list the tasks inside it. The same lookup pattern as calendars.
The same pattern every time:
def list_tasks(list_id: str) -> list:
task_result = toolset.execute_action(
Action.GOOGLETASKS_LIST_TASKS,
{"tasklist_id": list_id}
)
tasks = task_result.get("items", [])
print(f"Found {len(tasks)} tasks in list")
return tasksI can see my entire "Paper Review" backlog from a Python function. That's the input to add_task on Day 14.
Tasks without a due date won't have a due field — use .get("due", "no date") when parsing. And the task status field is "needsAction" (not done) or "completed" — useful for filtering your active backlog from completed items.
Google Tasks has two levels:
# Step 1: get task list IDs
lists = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
task_lists = lists.get("items", [])
# Step 2: get tasks from a specific list
tasks_result = toolset.execute_action(
Action.GOOGLETASKS_LIST_TASKS,
{"tasklist_id": "your_list_id"}
)
tasks = tasks_result.get("items", [])| Field | Meaning |
|---|---|
id | Task ID for updating |
title | Task name |
status | "needsAction" or "completed" |
due | Due date (may be absent) |
Your research task list has 15 to-dos from the last revision round. You want to build an automation that adds "Review new paper" tasks from the citation sheet. First you need the task list IDs. How do you get them?
find_events from Day 11 uses the calendar ID from list_calendars. For tasks, I'd expect a similar two-step: list the task lists first, then list the tasks inside a specific list.
Exactly right. First call GOOGLETASKS_LIST_TASK_LISTS to get your task lists — they're like notebooks, each with its own ID. Then call GOOGLETASKS_LIST_TASKS with a specific tasklist_id to get the tasks inside it:
list_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
task_lists = list_result.get("items", [])
# pick the list you want
task_result = toolset.execute_action(Action.GOOGLETASKS_LIST_TASKS, {"tasklist_id": list_id})
tasks = task_result.get("items", [])What's a task list vs a task? I thought Google Tasks just had tasks.
Google Tasks has a two-level hierarchy: task lists are like research notebooks ("Paper Review", "Admin", "Writing"), and tasks live inside lists. GOOGLETASKS_LIST_TASK_LISTS returns the notebooks; GOOGLETASKS_LIST_TASKS returns the tasks inside one notebook. You need the list ID to access the tasks.
So I find the "Paper Review" task list by its title, grab its ID, then list the tasks inside it. The same lookup pattern as calendars.
The same pattern every time:
def list_tasks(list_id: str) -> list:
task_result = toolset.execute_action(
Action.GOOGLETASKS_LIST_TASKS,
{"tasklist_id": list_id}
)
tasks = task_result.get("items", [])
print(f"Found {len(tasks)} tasks in list")
return tasksI can see my entire "Paper Review" backlog from a Python function. That's the input to add_task on Day 14.
Tasks without a due date won't have a due field — use .get("due", "no date") when parsing. And the task status field is "needsAction" (not done) or "completed" — useful for filtering your active backlog from completed items.
Google Tasks has two levels:
# Step 1: get task list IDs
lists = toolset.execute_action(Action.GOOGLETASKS_LIST_TASK_LISTS, {})
task_lists = lists.get("items", [])
# Step 2: get tasks from a specific list
tasks_result = toolset.execute_action(
Action.GOOGLETASKS_LIST_TASKS,
{"tasklist_id": "your_list_id"}
)
tasks = tasks_result.get("items", [])| Field | Meaning |
|---|---|
id | Task ID for updating |
title | Task name |
status | "needsAction" or "completed" |
due | Due date (may be absent) |
Create a free account to get started. Paid plans unlock all tracks.