Skip to content
POST
/api/v1/extract/tasks

Extract tasks API

Task-list items with section + progress.

POST /api/v1/extract/tasks returns every `- [ ]` / `- [x]` task in a markdown document grouped by section, with a percent-complete number ready for progress badges and dashboards.

Overview

Collect every GFM task-list item (`- [ ]` / `- [x]`) along with its parent heading. Returns totals and percent complete — perfect for progress badges in READMEs or project dashboards.

Request

Authenticate with Authorization: Bearer YOUR_API_KEY and send a JSON body containing the parameters below. Pick your language:

curl -X POST 'https://trymarkdownviewer.com/api/v1/extract/tasks' \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"markdown":"## TODO\n- [x] one\n- [ ] two"}'

Body parameters

FieldTypeRequiredDescription
markdownstring
required
Markdown source.

Response

Success responses are wrapped in a data field. Errors use { error: { code, message } } with an appropriate HTTP status — see the error reference.

{
  "data": {
    "tasks": [
      {
        "line": 2,
        "done": true,
        "text": "one",
        "section": "TODO"
      },
      {
        "line": 3,
        "done": false,
        "text": "two",
        "section": "TODO"
      }
    ],
    "total": 2,
    "done": 1,
    "open": 1,
    "percent": 50
  }
}

Use cases

README progress badges

Render a 'roadmap 47% done' shield from a TODO section.

Project dashboards

Pull tasks from a shared markdown plan into a unified view.

Try in browser

Free tools that run the same logic locally — no API key, no upload.

Try it

Send a real request against your account in the API playground. Errors there link straight back to the error reference.