ManKier API v3

Search for man pages, get information about them, get their contents. Explain whole commands.

Search Man Pages

Search man pages starting with “who”:
https://www.mankier.com/api/v3/mans/?q=who

Response is JSON:

{
  "q": "who",
  "truncated": false,
  "results": [
    {"name": "who", "section": "1", "description": "show who is logged on", "url": "https://www.mankier.com/1/who"},
    {"name": "who", "section": "1p", "description": "display who is on the system", "url": "https://www.mankier.com/1p/who"},
    {"name": "whom", "section": "1", "description": "report to whom a message would go"},
    ...
    {"name": "whois.jwhois", "section": "1", "description": "Alias of jwhois(1)", "url": "https://www.mankier.com/1/jwhois", "is_alias": true}
  ]
}
  

Up to 20 results will be returned. If more matching entries exist, truncated will be true.

If a result is a command alias, it gets a "is_alias": true property, and the "url" property points to the command for which it is an alias.

Optional request parameters:

Get Man Page Details

Get details for a man page:
https://www.mankier.com/api/v3/mans/ls.1

Returns Markdown by default, JSON if the HTTP request Accept header includes application/json.

Response as JSON:

{
  "name": "ls",
  "section": "1",
  "description": "list directory contents",
  "url": "https://www.mankier.com/1/ls",
  "sections": [
    {
      "id": "Synopsis",
      "title": "Synopsis",
      "url": "https://www.mankier.com/1/ls#Synopsis"
    },
    {
      "id": "Description",
      "title": "Description",
      "url": "https://www.mankier.com/1/ls#Description",
      "sections": [
        {
          "id": "Description-Exit_status",
          "title": "Exit status",
          "url": "https://www.mankier.com/1/ls#Description-Exit_status"
        },
        ...
      ]
    },
    ...
  ],
  "anchors": [
    {
      "anchor": "-1",
      "description": "list one file per line",
      "url": "https://www.mankier.com/1/ls#-1"
    },
    {
      "anchor": "-a, --all",
      "description": "do not ignore entries starting with .",
      "url": "https://www.mankier.com/1/ls#-a"
    },
    ...
  ]
}

Response as Markdown:

# ls.1

list directory contents

## Sections

- [Synopsis](https://www.mankier.com/1/ls#Synopsis), id: Synopsis
- [Description](https://www.mankier.com/1/ls#Description), id: Description
  - [Exit status](https://www.mankier.com/1/ls#Description-Exit_status), id: Description-Exit_status
...

## Anchors

[**-1**](https://www.mankier.com/1/ls#-1)

:   list one file per line

[**-a, --all**](https://www.mankier.com/1/ls#-a)

:   do not ignore entries starting with .

...

Anchors returned are definitions at the given url that can be directly linked to.

Get a Man Page Section

Get the contents of a section in a man page:
https://www.mankier.com/api/v3/mans/ls.1/sections/Synopsis
(the last thing in the path is a section id - see Get Man Page Details.)

Response is Markdown:

# ls.1

## Description

List information about the FILEs (the current directory by default).
Sort entries alphabetically if none of -cftuvSUX nor --sort is
specified.

Mandatory arguments to long options are mandatory for short options too.

-a,  --all

:   do not ignore entries starting with .

-A,  --almost-all

:   do not list implied . and ..

This also works for subsections (sections within sections):
https://www.mankier.com/api/v3/mans/ls.1/sections/Description-Exit_status

Get Man Page References

Get all the connections from and to a man page, and also any connections between its connections:
https://www.mankier.com/api/v3/mesh/who.1

Response is JSON:

[
  {"f": "talk.1", "t": "who.1"},
  {"f": "write.1", "t": "who.1"},
  ...
]

Explain a Shell Command

Explain ls -lh, wrapping text at 70 chars (optional):
https://www.mankier.com/api/v3/explain/?cols=70&q=ls -lh

Result is plain text:

ls(1)
  list directory contents

  -l (-l)
    use a long listing format

  -h (-h, --human-readable)
    with -l and -s, print sizes like 1K 234M 2G etc.
                                          https://www.mankier.com/1/ls

History