Google Tasks
List completed Google Tasks
Set showCompleted and showHidden when you need tasks completed in Google’s web or mobile clients. Keep the records whose status is completed and follow the response’s page token.
Documentation reviewed · 2 methods with sources
Ways to do it
- API: GET /tasks/v1/lists/{tasklist}/tasks?showHidden=true
- SDK: tasks.tasks.list({ tasklist, showHidden: true })
API
GET /tasks/v1/lists/{tasklist}/tasks?showHidden=true
Read one task list with showCompleted and showHidden. Keep items with status=completed and pass nextPageToken as pageToken to retrieve another page.
Read source: Google Tasks tasks.list reference- Requirements
- OAuth access to the task list and the tasks.readonly or tasks scope, plus the task list ID.
- Limitations
- The page cap is 100 tasks. Google clients can hide tasks when marking them complete, so set both flags to retrieve those completions.
Example shell
curl --fail -H "Authorization: Bearer $GOOGLE_ACCESS_TOKEN" "https://tasks.googleapis.com/tasks/v1/lists/$TASK_LIST_ID/tasks?showCompleted=true&showHidden=true&maxResults=100" | jq '{nextPageToken, items: [.items[]? | select(.status == "completed")]}'SDK
tasks.tasks.list({ tasklist, showHidden: true })
Call the Google API client and filter each page by completed status. Use nextPageToken to retrieve the next result page.
Read source: Pinned Google Tasks Node.js client method- Requirements
- The googleapis Node.js client with OAuth credentials that can read the task list and its task list ID.
- Limitations
- The generated client returns one list page per call. Pass nextPageToken as pageToken to continue a sync.
Example text
const { data } = await tasks.tasks.list({ tasklist: taskListId, showCompleted: true, showHidden: true, maxResults: 100 });
const completed = (data.items ?? []).filter(({ status }) => status === "completed");