# Software Heritage

> Search the Software Heritage archive of public source code: look up a repository and its visits, branches, commits, releases, folders and files, resolve SWHIDs, get citations, metadata and known vulnerabilities, ask for a repository to be archived, and run a workflow when the archive visits one. No account or API key required.

App · 19 actions. Web page: https://docs.lodol.com/docs/integrations/software-heritage

## Actions

### Check SWHIDs are archived

Check which of up to 1,000 SWHIDs of files, folders, commits, releases or snapshots are in the archive.

**Inputs**

- SWHIDs (`swhids`, list, required): The SWHIDs to check, as a list or separated by commas or new lines. Qualifiers after a ; are ignored.

**Outputs**

- `all_archived` (true/false): True when every one is in the archive.
- `archived_count` (number): How many are in the archive.
- `count` (number): How many SWHIDs were checked.
- `missing_count` (number): How many are not.
- `results` (list): Each SWHID, in the order given.
- `summary` (text): One line saying what was found.

**Example output**

```json
{
  "all_archived": false,
  "archived_count": 2,
  "count": 3,
  "missing_count": 1,
  "results": [
    {
      "archived": true,
      "swhid": "swh:1:rev:9022bdc093f3540cede505084969311473adbb09",
      "type": "commit"
    },
    {
      "archived": true,
      "swhid": "swh:1:dir:2775a5a092ca53c424b008fe168123c55ab1aa85",
      "type": "folder"
    },
    {
      "archived": false,
      "swhid": "swh:1:cnt:0000000000000000000000000000000000000000",
      "type": "file"
    }
  ],
  "summary": "2 of 3 are in the archive."
}
```

### Get archive statistics

Get how many repositories, visits, files, folders, commits, releases and authors the archive holds.

**Inputs**: None.

**Outputs**

- `authors` (number): How many distinct authors and committers.
- `commits` (number): How many distinct commits.
- `files` (number): How many distinct files it holds.
- `folders` (number): How many distinct folders.
- `releases` (number): How many distinct releases.
- `repositories` (number): How many repositories and packages the archive holds.
- `skipped_files` (number): How many files it skipped, such as very large ones.
- `snapshots` (number): How many distinct snapshots.
- `summary` (text): One line saying what was found.
- `visits` (number): How many visits it has made to them.

**Example output**

```json
{
  "authors": 111378307,
  "commits": 6290094306,
  "files": 30679513558,
  "folders": 23908897342,
  "releases": 196885845,
  "repositories": 452896869,
  "skipped_files": 788693,
  "snapshots": 417231995,
  "summary": "The archive holds 30,679,513,558 files and 6,290,094,306 commits from 452,896,869 repositories.",
  "visits": 2059307217
}
```

### Get citation

Get a citation for software in BibTeX or CSL JSON, made from its codemeta.json or CITATION.cff in the archive, with its SWHID.

**Inputs**

- Repository or SWHID (`software`, text, required): The repository's address, for its latest version, or the SWHID of a version of it.
- Format (`citation_format`, text): The citation's format. Defaults to BibTeX. One of: `bibtex`, `csl` (CSL JSON). Default: `bibtex`.

**Outputs**

- `citation` (text): The citation, ready to paste into a bibliography.
- `format` (text): bibtex or csl.
- `source_swhid` (text): The SWHID of the file the citation was made from, such as codemeta.json or CITATION.cff.
- `source_url` (text): Where to download that file.
- `summary` (text): One line saying what was found.
- `warning` (text): What the archive found wrong with that file, if anything.

**Example output**

```json
{
  "citation": "@softwareversion{swh-rev-9022bdc,\n    author = \"Di Cosmo, Roberto and Danelutto, Marco\",\n    organization = \"Inria and University Paris Diderot and University of Pisa\",\n    license = \"LGPL-2.0-only\",\n    date = \"2011-07-18\",\n    year = \"2011\",\n    month = jul,\n    repository = \"git+https://github.com/rdicosmo/parmap.git\",\n    title = \"Parmap\",\n    version = \"1.2.5\",\n    swhid = \"swh:1:rev:9022bdc093f3540cede505084969311473adbb09;origin=https://github.com/rdicosmo/parmap;visit=swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf\"\n}\n",
  "format": "bibtex",
  "source_swhid": "swh:1:cnt:7104fab006bbeb57dc12f72d158fe4f2c63a9b27;origin=https://github.com/rdicosmo/parmap;visit=swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf;anchor=swh:1:rev:9022bdc093f3540cede505084969311473adbb09;path=/codemeta.json",
  "source_url": "https://archive.softwareheritage.org/api/1/content/sha1_git:7104fab006bbeb57dc12f72d158fe4f2c63a9b27/raw/",
  "summary": "Citation of https://github.com/rdicosmo/parmap in bibtex.",
  "warning": null
}
```

### Get commit

Get an archived commit: its message, author, committer, dates, the commits before it and its top folder.

**Inputs**

- Commit (`commit`, text, required): The commit's 40-character id or its SWHID (swh:1:rev:...). Its page on GitHub or GitLab works too.

**Outputs**

- `author_email` (text): The author's email address, as recorded in the commit.
- `author_name` (text): Who wrote the change.
- `browse_url` (text): The archive's page for it, to open in a browser.
- `committer_date` (text): When it was committed (ISO 8601, with its time zone).
- `committer_email` (text): The committer's email address.
- `committer_name` (text): Who committed it.
- `date` (text): When the change was written (ISO 8601, with its time zone).
- `folder_id` (text): The id of the commit's top folder, for List folder.
- `id` (text): The commit's id, the same as Git's.
- `is_merge` (true/false): True for a merge commit.
- `message` (text): The whole commit message.
- `parent_ids` (list): The ids of the commits it follows; two or more for a merge.
- `summary` (text): One line saying what was found.
- `swhid` (text): The commit's SWHID, e.g. swh:1:rev:9022bdc0...
- `title` (text): The first line of the commit message.
- `type` (text): The version control it came from, e.g. git.

**Example output**

```json
{
  "author_email": "roberto@dicosmo.org",
  "author_name": "Roberto Di Cosmo",
  "browse_url": "https://archive.softwareheritage.org/swh:1:rev:9022bdc093f3540cede505084969311473adbb09",
  "committer_date": "2026-06-06T12:26:49+02:00",
  "committer_email": "noreply@github.com",
  "committer_name": "GitHub",
  "date": "2026-06-06T12:26:49+02:00",
  "folder_id": "2775a5a092ca53c424b008fe168123c55ab1aa85",
  "id": "9022bdc093f3540cede505084969311473adbb09",
  "is_merge": true,
  "message": "Merge pull request #116 from rdicosmo/fix/103-no-infinite-loop-on-pinning-failure\n\nsetcore: avoid infinite loop when core pinning always fails (#103)",
  "parent_ids": [
    "e09335913d101320172833f725cf87486ad8c085",
    "1c7c605ef71509053cee53946faa75de4c6b728d"
  ],
  "summary": "Commit 9022bdc093f3 by Roberto Di Cosmo on 2026-06-06T12:26:49+02:00: Merge pull request #116 from rdicosmo/fix/103-no-infinite-loop-on-pinning-failure",
  "swhid": "swh:1:rev:9022bdc093f3540cede505084969311473adbb09",
  "title": "Merge pull request #116 from rdicosmo/fix/103-no-infinite-loop-on-pinning-failure",
  "type": "git"
}
```

### Get file

Check an archived file and get its size, its SWHID and its SHA1, SHA256 and other checksums.

**Inputs**

- File (`file`, text, required): The file's SWHID (swh:1:cnt:...) or id, as List folder gives them, or a checksum written as sha256:... or sha1:...

**Outputs**

- `blake2s256` (text): Its BLAKE2s256 checksum.
- `browse_url` (text): The archive's page for it, to open in a browser.
- `sha1` (text): Its SHA1 checksum.
- `sha1_git` (text): Its SHA1 Git checksum, the same as Git's blob id.
- `sha256` (text): Its SHA256 checksum.
- `size` (number): Its size in bytes.
- `status` (text): visible, or absent when the archive holds only its checksums.
- `summary` (text): One line saying what was found.
- `swhid` (text): The file's SWHID, e.g. swh:1:cnt:43243e2a...

**Example output**

```json
{
  "blake2s256": "029f38fa367e14554e775bdbf4f50cc112d7a6df1b1d370566d6906aba59f8d2",
  "browse_url": "https://archive.softwareheritage.org/swh:1:cnt:43243e2ae91a64e252170cd922718e8c2af323b6",
  "sha1": "b2da9d1ed869c8a111d1dc8b7c85d4f63921b6b1",
  "sha1_git": "43243e2ae91a64e252170cd922718e8c2af323b6",
  "sha256": "98fc4011efba9bbe8df865124e4ebca3faae614d0b798cff0f1ccdbbbca5d7a9",
  "size": 7225,
  "status": "visible",
  "summary": "File swh:1:cnt:43243e2ae91a64e252170cd922718e8c2af323b6 is archived: 7225 bytes.",
  "swhid": "swh:1:cnt:43243e2ae91a64e252170cd922718e8c2af323b6"
}
```

### Get file text

Read an archived text file, such as a README or source file, up to a number of bytes. Binary files are refused.

**Inputs**

- File (`file`, text, required): The file's SWHID (swh:1:cnt:...) or id, as List folder gives them, or a checksum written as sha256:... or sha1:...
- Most bytes (`max_bytes`, number): Read at most this many bytes, from 1 to 1,000,000. Defaults to 100,000. From 1 to 1000000. Default: `100000`.

**Outputs**

- `bytes_read` (number): How many bytes the text holds.
- `size` (number): The file's whole size in bytes.
- `summary` (text): One line saying what was found.
- `swhid` (text): The file's SWHID, when it was named by one or its id.
- `text` (text): The file's text, read as UTF-8.
- `truncated` (true/false): True when the file is longer than Most bytes.

**Example output**

```json
{
  "bytes_read": 300,
  "size": 600,
  "summary": "Read the first 300 bytes of the file.",
  "swhid": "swh:1:cnt:43243e2ae91a64e252170cd922718e8c2af323b6",
  "text": "# Parmap in a nutshell\n\nParmap is a minimalistic library allowing  to exploit multicore architecture for\nOCaml programs with minimal modifications: if you want to use your many cores to\naccelerate an   operation  which  happens   to be   a  map,  fold    or map/fold\n(map-reduce),  just use  Parmap's",
  "truncated": true
}
```

### Get release

Get an archived release (a tag): its name, message, author, date and the commit it marks.

**Inputs**

- Release (`release`, text, required): The release's SWHID (swh:1:rel:...) or id, as List branches gives them for tags.

**Outputs**

- `author_email` (text): Their email address.
- `author_name` (text): Who made the release.
- `browse_url` (text): The archive's page for it, to open in a browser.
- `date` (text): When it was made (ISO 8601, with its time zone).
- `id` (text): The release's id, the same as Git's tag id.
- `message` (text): The release's message.
- `name` (text): The release's name, e.g. 1.2.5.
- `summary` (text): One line saying what was found.
- `swhid` (text): The release's SWHID.
- `target_id` (text): The id of what it points at.
- `target_swhid` (text): The SWHID of what it points at.
- `target_type` (text): What it points at, usually revision (a commit).

**Example output**

```json
{
  "author_email": "github@dicosmo.org",
  "author_name": "Roberto Di Cosmo",
  "browse_url": "https://archive.softwareheritage.org/swh:1:rel:3e7076586691d4e363689fbf5374f833289e0b98",
  "date": "2015-09-17T16:35:00+02:00",
  "id": "3e7076586691d4e363689fbf5374f833289e0b98",
  "message": "Improved autoconf\n",
  "name": "1.0-rc7",
  "summary": "Release 1.0-rc7 of 2015-09-17T16:35:00+02:00, pointing at revision a9f3396f372ed4a51d75e15ca16c1c2df1fc5c97.",
  "swhid": "swh:1:rel:3e7076586691d4e363689fbf5374f833289e0b98",
  "target_id": "a9f3396f372ed4a51d75e15ca16c1c2df1fc5c97",
  "target_swhid": "swh:1:rev:a9f3396f372ed4a51d75e15ca16c1c2df1fc5c97",
  "target_type": "revision"
}
```

### Get repository

Check that a repository is in the archive and get the address it is filed under, its SWHID, how the archive reads it and its page.

**Inputs**

- Repository (`repository`, text, required): The repository's address, e.g. https://github.com/rdicosmo/parmap. A clone address or a page inside the repository works too.

**Outputs**

- `browse_url` (text): The archive's page for the repository.
- `summary` (text): One line saying what was found.
- `swhid` (text): The repository's SWHID, e.g. swh:1:ori:8903a90c...
- `url` (text): The repository's address, as the archive files it.
- `visit_types` (list): How the archive reads it, e.g. git.

**Example output**

```json
{
  "browse_url": "https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/rdicosmo/parmap",
  "summary": "https://github.com/rdicosmo/parmap is in the Software Heritage archive, visited as git, git-checkout.",
  "swhid": "swh:1:ori:8903a90cff8f07159be7aed69f19d66d33db3f86",
  "url": "https://github.com/rdicosmo/parmap",
  "visit_types": [
    "git",
    "git-checkout"
  ]
}
```

### Get save request status

Check how a request to archive a repository is going, by its number, or list a repository's requests, newest first.

**Inputs**

- Save request or repository (`request`, text, required): The save request's number, as Request an archive gives it, or a repository's address for its requests.
- Kind of repository (`visit_type`, text): The version control the repository uses. Defaults to Git. One of: `git`, `hg` (Mercurial), `svn` (Subversion), `bzr` (Bazaar), `cvs`, `tarball` (Tarball (a .tar.gz or .zip file)). Default: `git`.
- Most requests (`limit`, number): For a repository, how many requests to list, from 1 to 100. Defaults to 10. From 1 to 100. Default: `10`.

**Outputs**

- `count` (number): How many save requests are listed.
- `note` (text): Why the request was rejected or failed, when it says.
- `repository` (text): The repository to archive.
- `request_id` (number): The save request's number, for Get save request.
- `request_status` (text): accepted, rejected, or pending while Software Heritage checks an address it doesn't know.
- `requested_at` (text): When the request was made (ISO 8601, UTC).
- `requests` (list): The save requests, newest first; the fields above are the newest's.
- `snapshot_swhid` (text): The SWHID of the snapshot it took, once it has.
- `summary` (text): One line saying what was found.
- `task_status` (text): Where the archiving is: not created, pending, scheduled, running, succeeded or failed.
- `total` (number): How many there are for the repository in all.
- `visit_date` (text): When the visit was made (ISO 8601, UTC).
- `visit_status` (text): How the visit ended, once it has: full, partial or failed.
- `visit_type` (text): Its kind: git, hg, svn, bzr, cvs or tarball.

**Example output**

```json
{
  "count": 2,
  "note": null,
  "repository": "https://github.com/rdicosmo/parmap",
  "request_id": 2607819,
  "request_status": "accepted",
  "requested_at": "2026-11-02T19:06:33.711966+00:00",
  "requests": [
    {
      "note": null,
      "repository": "https://github.com/rdicosmo/parmap",
      "request_id": 2607819,
      "request_status": "accepted",
      "requested_at": "2026-11-02T19:06:33.711966+00:00",
      "snapshot_swhid": null,
      "summary": "Save request 2607819 for https://github.com/rdicosmo/parmap: accepted, archiving pending.",
      "task_status": "pending",
      "visit_date": null,
      "visit_status": null,
      "visit_type": "git"
    },
    {
      "note": null,
      "repository": "https://github.com/rdicosmo/parmap",
      "request_id": 2607812,
      "request_status": "accepted",
      "requested_at": "2026-11-02T18:56:22.453274+00:00",
      "snapshot_swhid": "swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
      "summary": "Save request 2607812 for https://github.com/rdicosmo/parmap: accepted, archiving succeeded.",
      "task_status": "succeeded",
      "visit_date": "2026-11-02T18:56:28.959000+00:00",
      "visit_status": "full",
      "visit_type": "git"
    }
  ],
  "snapshot_swhid": null,
  "summary": "Save request 2607819 for https://github.com/rdicosmo/parmap: accepted, archiving pending.",
  "task_status": "pending",
  "total": 2,
  "visit_date": null,
  "visit_status": null,
  "visit_type": "git"
}
```

### Get software metadata

Get what a repository says about itself, read from files such as codemeta.json and package.json: name, description, version, licences, authors, languages and keywords.

**Inputs**

- Repository (`repository`, text, required): The repository's address, e.g. https://github.com/rdicosmo/parmap. A clone address or a page inside the repository works too.

**Outputs**

- `authors` (list): Its authors.
- `code_repository` (text): Where its code lives, as it says.
- `date_created` (text): When it was created, as it says.
- `date_modified` (text): When it was last changed, as it says.
- `date_published` (text): When it was first published, as it says.
- `description` (text): What it does, in its own words.
- `homepage` (text): Its home page.
- `issue_tracker` (text): Where to report problems.
- `keywords` (list): Its keywords.
- `licenses` (list): Its licences, as SPDX ids where it gives them, e.g. MIT.
- `name` (text): The software's name.
- `programming_languages` (list): The languages it is written in.
- `repository` (text): The repository's address.
- `summary` (text): One line saying what was found.
- `version` (text): Its version.

**Example output**

```json
{
  "authors": [
    {
      "affiliation": "Inria and University Paris Diderot",
      "email": "roberto@dicosmo.org",
      "id": "https://orcid.org/0000-0002-7493-5349",
      "name": "Roberto Di Cosmo"
    },
    {
      "affiliation": "University of Pisa",
      "email": "marco.danelutto@unipi.it",
      "id": "https://orcid.org/0000-0002-7433-376X",
      "name": "Marco Danelutto"
    }
  ],
  "code_repository": "git+https://github.com/rdicosmo/parmap.git",
  "date_created": null,
  "date_modified": "2022-01-03",
  "date_published": "2011-07-18",
  "description": null,
  "homepage": null,
  "issue_tracker": "https://github.com/rdicosmo/parmap/issues",
  "keywords": [],
  "licenses": [
    "LGPL-2.0-only"
  ],
  "name": "Parmap",
  "programming_languages": [
    "OCaml"
  ],
  "repository": "https://github.com/rdicosmo/parmap",
  "summary": "Parmap: 2 authors, licence LGPL-2.0-only.",
  "version": "1.2.5"
}
```

### Get visit

Get one visit of a repository, the latest unless you give its number: when it was, how it went and the snapshot it took.

**Inputs**

- Repository (`repository`, text, required): The repository's address, e.g. https://github.com/rdicosmo/parmap. A clone address or a page inside the repository works too.
- Visit number (`visit`, number): The visit's number. Leave blank for the latest. At least 1.
- Visit type (`visit_type`, text): Only visits of this type, e.g. git. Get repository lists a repository's types. Leave blank for any.
- Only complete visits (`require_snapshot`, true/false): For the latest visit, skip visits still running or that took no snapshot. Defaults to yes. Default: `true`.

**Outputs**

- `browse_url` (text): The archive's page for it, to open in a browser.
- `date` (text): When the visit started (ISO 8601, UTC).
- `repository` (text): The address of the repository visited.
- `snapshot_id` (text): The id of the snapshot the visit took: every branch and tag it found. Empty when it took none.
- `snapshot_swhid` (text): The snapshot's SWHID, e.g. swh:1:snp:6146f8ce...
- `status` (text): How the visit ended: full, partial, failed or not_found, or created or ongoing while it runs.
- `summary` (text): One line saying what was found.
- `visit` (number): The visit's number, counting up from 1 for each repository.
- `visit_type` (text): How the archive read the repository, e.g. git, or git-checkout for a package's source.

**Example output**

```json
{
  "browse_url": "https://archive.softwareheritage.org/swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
  "date": "2026-11-02T18:56:28.959000+00:00",
  "repository": "https://github.com/rdicosmo/parmap",
  "snapshot_id": "6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
  "snapshot_swhid": "swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
  "status": "full",
  "summary": "Visit 2534 of https://github.com/rdicosmo/parmap on 2026-11-02T18:56:28.959000+00:00 (git): full.",
  "visit": 2534,
  "visit_type": "git"
}
```

### List branches

List the branches and tags in a snapshot, or in a repository's latest one, with the commit or release each points at. HEAD shows the default branch's latest commit.

**Inputs**

- Snapshot or repository (`snapshot`, text, required): A snapshot's SWHID (swh:1:snp:...) or id, as a visit gives them, or a repository's address for its latest snapshot.
- Branch types (`branch_types`, list): Only branches pointing at these. Leave blank for all. One or more of: `revision` (Commits (branches)), `release` (Releases (tags)), `alias` (Aliases, such as HEAD), `directory` (Folders), `content` (Files), `snapshot` (Snapshots).
- Start from (`start_from`, text): List branches from this name on, alphabetically, e.g. refs/tags/. Each answer gives the name to use next.
- Most branches (`limit`, number): How many to list, from 1 to 1000. Defaults to 100. From 1 to 1000. Default: `100`.

**Outputs**

- `branches` (list): The branches and tags, by name.
- `browse_url` (text): The archive's page for it, to open in a browser.
- `count` (number): How many branches are listed.
- `has_more` (true/false): True when there are more branches.
- `next_branch` (text): Give this as Start from to list the next ones.
- `repository` (text): The repository whose latest snapshot this is, when a repository was given.
- `snapshot_id` (text): The snapshot's id.
- `snapshot_swhid` (text): The snapshot's SWHID.
- `summary` (text): One line saying what was found.

**Example output**

```json
{
  "branches": [
    {
      "alias_of": "refs/heads/master",
      "name": "HEAD",
      "target_id": "9022bdc093f3540cede505084969311473adbb09",
      "target_swhid": "swh:1:rev:9022bdc093f3540cede505084969311473adbb09",
      "target_type": "revision"
    },
    {
      "alias_of": null,
      "name": "refs/heads/Drup-dune",
      "target_id": "312998462027e0ca6278d0eed3bc36ae9099db8d",
      "target_swhid": "swh:1:rev:312998462027e0ca6278d0eed3bc36ae9099db8d",
      "target_type": "revision"
    },
    {
      "alias_of": null,
      "name": "refs/heads/UnixJunkie-patch-1",
      "target_id": "dd932dcf58fecc4871847e46745f32a2137cdfea",
      "target_swhid": "swh:1:rev:dd932dcf58fecc4871847e46745f32a2137cdfea",
      "target_type": "revision"
    },
    {
      "alias_of": null,
      "name": "refs/heads/diml-master",
      "target_id": "99d9d23e80e3bdd196ea0eda76e60b51423416c7",
      "target_swhid": "swh:1:rev:99d9d23e80e3bdd196ea0eda76e60b51423416c7",
      "target_type": "revision"
    },
    {
      "alias_of": null,
      "name": "refs/heads/fastarraymap",
      "target_id": "0a176436462903e284ece51dfa2789354b16905b",
      "target_swhid": "swh:1:rev:0a176436462903e284ece51dfa2789354b16905b",
      "target_type": "revision"
    }
  ],
  "browse_url": "https://archive.softwareheritage.org/swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
  "count": 5,
  "has_more": true,
  "next_branch": "refs/heads/feat/77-no-fork-on-ncores-1",
  "repository": null,
  "snapshot_id": "6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
  "snapshot_swhid": "swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
  "summary": "Listed 5 branches of snapshot 6146f8cebe5245a915c21ad9186ddb0acecbd1bf."
}
```

### List commit history

List the commits leading to a commit, starting with it and going back in time, like git log.

**Inputs**

- Commit (`commit`, text, required): The commit's 40-character id or its SWHID (swh:1:rev:...). Its page on GitHub or GitLab works too.
- Most commits (`limit`, number): How many commits to list, from 1 to 1000. Defaults to 10. From 1 to 1000. Default: `10`.

**Outputs**

- `commit_id` (text): The commit the history leads to.
- `commits` (list): The commits, starting with the one given and going back in time.
- `count` (number): How many commits are listed.
- `summary` (text): One line saying what was found.

**Example output**

```json
{
  "commit_id": "9022bdc093f3540cede505084969311473adbb09",
  "commits": [
    {
      "author_email": "roberto@dicosmo.org",
      "author_name": "Roberto Di Cosmo",
      "browse_url": "https://archive.softwareheritage.org/swh:1:rev:9022bdc093f3540cede505084969311473adbb09",
      "committer_date": "2026-06-06T12:26:49+02:00",
      "committer_email": "noreply@github.com",
      "committer_name": "GitHub",
      "date": "2026-06-06T12:26:49+02:00",
      "folder_id": "2775a5a092ca53c424b008fe168123c55ab1aa85",
      "id": "9022bdc093f3540cede505084969311473adbb09",
      "is_merge": true,
      "message": "Merge pull request #116 from rdicosmo/fix/103-no-infinite-loop-on-pinning-failure\n\nsetcore: avoid infinite loop when core pinning always fails (#103)",
      "parent_ids": [
        "e09335913d101320172833f725cf87486ad8c085",
        "1c7c605ef71509053cee53946faa75de4c6b728d"
      ],
      "swhid": "swh:1:rev:9022bdc093f3540cede505084969311473adbb09",
      "title": "Merge pull request #116 from rdicosmo/fix/103-no-infinite-loop-on-pinning-failure",
      "type": "git"
    },
    {
      "author_email": "roberto@dicosmo.org",
      "author_name": "Roberto Di Cosmo",
      "browse_url": "https://archive.softwareheritage.org/swh:1:rev:e09335913d101320172833f725cf87486ad8c085",
      "committer_date": "2026-04-25T01:35:30+02:00",
      "committer_email": "noreply@github.com",
      "committer_name": "GitHub",
      "date": "2026-04-25T01:35:30+02:00",
      "folder_id": "86deca89e02b8c0a50396fd96e33d2836362fa3c",
      "id": "e09335913d101320172833f725cf87486ad8c085",
      "is_merge": true,
      "message": "Merge pull request #117 from rdicosmo/feat/77-no-fork-on-ncores-1\n\nparmap: skip fork when ~ncores=1 (#77)",
      "parent_ids": [
        "ecd3744ed558da4ea2bf9eb87b80b8949f417126",
        "79db0f03206422038aec8d36bd0039c43ce17f28"
      ],
      "swhid": "swh:1:rev:e09335913d101320172833f725cf87486ad8c085",
      "title": "Merge pull request #117 from rdicosmo/feat/77-no-fork-on-ncores-1",
      "type": "git"
    }
  ],
  "count": 2,
  "summary": "Listed 2 commits leading to 9022bdc093f3, newest first."
}
```

### List folder

List the files and folders in an archived folder, or in a commit's files at a path, with each one's size and SWHID. A path to a file gives that one file.

**Inputs**

- Folder or commit (`folder`, text, required): A folder's or a commit's SWHID (swh:1:dir:... or swh:1:rev:...) or id. A commit lists its top folder.
- Path (`path`, text): A folder or file inside it, e.g. src or docs/README.md. Leave blank for the folder itself.

**Outputs**

- `browse_url` (text): The archive's page for it, to open in a browser.
- `count` (number): How many entries are listed.
- `entries` (list): What the folder holds, or the one file the path names.
- `file_count` (number): How many of them are files.
- `folder_count` (number): How many of them are folders.
- `folder_id` (text): The id of the folder listed, when it is a folder.
- `folder_swhid` (text): Its SWHID.
- `path` (text): The path given, from the top folder; empty for the top.
- `summary` (text): One line saying what was found.
- `type` (text): folder, or file when the path names a file.

**Example output**

```json
{
  "browse_url": "https://archive.softwareheritage.org/swh:1:dir:2775a5a092ca53c424b008fe168123c55ab1aa85",
  "count": 4,
  "entries": [
    {
      "browse_url": "https://archive.softwareheritage.org/swh:1:cnt:8d9ac6745d9e09a76bee9254569c07296420dd33",
      "id": "8d9ac6745d9e09a76bee9254569c07296420dd33",
      "name": ".gitignore",
      "size": 38,
      "swhid": "swh:1:cnt:8d9ac6745d9e09a76bee9254569c07296420dd33",
      "type": "file"
    },
    {
      "browse_url": "https://archive.softwareheritage.org/swh:1:cnt:0164c78f68e74c1950bb15bb65f26af85409be1b",
      "id": "0164c78f68e74c1950bb15bb65f26af85409be1b",
      "name": "AUTHORS",
      "size": 722,
      "swhid": "swh:1:cnt:0164c78f68e74c1950bb15bb65f26af85409be1b",
      "type": "file"
    },
    {
      "browse_url": "https://archive.softwareheritage.org/swh:1:cnt:6b04cd329678804c29f57c396dc80673f51e6122",
      "id": "6b04cd329678804c29f57c396dc80673f51e6122",
      "name": "CHANGES",
      "size": 1821,
      "swhid": "swh:1:cnt:6b04cd329678804c29f57c396dc80673f51e6122",
      "type": "file"
    },
    {
      "browse_url": "https://archive.softwareheritage.org/swh:1:cnt:1236c69684fe78ffa93fe0c712b28e7db2e1dec0",
      "id": "1236c69684fe78ffa93fe0c712b28e7db2e1dec0",
      "name": "LICENSE",
      "size": 26457,
      "swhid": "swh:1:cnt:1236c69684fe78ffa93fe0c712b28e7db2e1dec0",
      "type": "file"
    }
  ],
  "file_count": 4,
  "folder_count": 0,
  "folder_id": "2775a5a092ca53c424b008fe168123c55ab1aa85",
  "folder_swhid": "swh:1:dir:2775a5a092ca53c424b008fe168123c55ab1aa85",
  "path": "",
  "summary": "Listed 4 entries of the top folder: 4 files.",
  "type": "folder"
}
```

### List visits

List the times the archive read a repository, newest first: when, how it went, and the snapshot of branches and tags it took.

**Inputs**

- Repository (`repository`, text, required): The repository's address, e.g. https://github.com/rdicosmo/parmap. A clone address or a page inside the repository works too.
- Most visits (`limit`, number): How many visits to list, from 1 to 100. Defaults to 25. From 1 to 100. Default: `25`.
- Before visit (`before_visit`, number): Only visits older than this visit number, to read further back. Each answer gives the number to use next. At least 1.

**Outputs**

- `count` (number): How many visits are listed.
- `has_more` (true/false): True when there are older visits.
- `next_before_visit` (number): Give this as Before visit to list the older ones.
- `repository` (text): The repository's address.
- `summary` (text): One line saying what was found.
- `visits` (list): The visits, newest first.

**Example output**

```json
{
  "count": 3,
  "has_more": true,
  "next_before_visit": 2532,
  "repository": "https://github.com/rdicosmo/parmap",
  "summary": "Listed 3 archive visits of https://github.com/rdicosmo/parmap, newest first.",
  "visits": [
    {
      "browse_url": "https://archive.softwareheritage.org/swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
      "date": "2026-11-02T18:56:28.959000+00:00",
      "repository": "https://github.com/rdicosmo/parmap",
      "snapshot_id": "6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
      "snapshot_swhid": "swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
      "status": "full",
      "visit": 2534,
      "visit_type": "git"
    },
    {
      "browse_url": "https://archive.softwareheritage.org/swh:1:snp:2128ed4f25f2d7ae7c8b7950a611d69cf4429063",
      "date": "2026-11-02T12:47:17.005000+00:00",
      "repository": "https://github.com/rdicosmo/parmap",
      "snapshot_id": "2128ed4f25f2d7ae7c8b7950a611d69cf4429063",
      "snapshot_swhid": "swh:1:snp:2128ed4f25f2d7ae7c8b7950a611d69cf4429063",
      "status": "full",
      "visit": 2533,
      "visit_type": "git-checkout"
    },
    {
      "browse_url": "https://archive.softwareheritage.org/swh:1:snp:2128ed4f25f2d7ae7c8b7950a611d69cf4429063",
      "date": "2026-11-02T00:35:01.038000+00:00",
      "repository": "https://github.com/rdicosmo/parmap",
      "snapshot_id": "2128ed4f25f2d7ae7c8b7950a611d69cf4429063",
      "snapshot_swhid": "swh:1:snp:2128ed4f25f2d7ae7c8b7950a611d69cf4429063",
      "status": "full",
      "visit": 2532,
      "visit_type": "git-checkout"
    }
  ]
}
```

### List vulnerabilities

List the known security vulnerabilities, such as CVEs, that affect a commit, with their severity, references and fixing commits, from the osv.dev database.

**Inputs**

- Commit (`commit`, text, required): The commit's 40-character id or its SWHID (swh:1:rev:...). Its page on GitHub or GitLab works too.

**Outputs**

- `commit_id` (text): The commit checked.
- `count` (number): How many known vulnerabilities affect it.
- `summary` (text): One line saying what was found.
- `vulnerabilities` (list): The vulnerabilities, one per identifier.

**Example output**

```json
{
  "commit_id": "45a9f284641a23baa142743d8a6136d4e300c465",
  "count": 1,
  "summary": "1 known vulnerabilities affect commit 45a9f284641a.",
  "vulnerabilities": [
    {
      "aliases": [],
      "details": "ohmyzsh is vulnerable to Improper Neutralization of Special Elements used in an OS Command",
      "fixed_in": [
        "6cb41b70a6d04301fd50cd5862ecd705ba226c0e"
      ],
      "id": "CVE-2021-3934",
      "modified": "2026-03-13T21:53:09.633331672Z",
      "published": "2021-11-12T12:15:07.460Z",
      "references": [
        "https://huntr.dev/bounties/ad2b5c3f-a3ce-4407-94dc-354c723310ce",
        "https://github.com/ohmyzsh/ohmyzsh/commit/6cb41b70a6d04301fd50cd5862ecd705ba226c0e"
      ],
      "severity": [
        "CVSS:3.1/AV:N/AC:H/PR:N/UI:R/S:U/C:H/I:H/A:H"
      ],
      "source": "osv.dev",
      "summary": "ohmyzsh is vulnerable to Improper Neutralization of Special Elements used in an OS Command"
    }
  ]
}
```

### Request an archive of a repository

Ask Software Heritage to archive a public repository now (its Save Code Now). Well known forges such as GitHub are accepted at once; other addresses wait for a check.

**Inputs**

- Repository (`repository`, text, required): The repository's address, e.g. https://github.com/rdicosmo/parmap. A clone address or a page inside the repository works too.
- Kind of repository (`visit_type`, text): The version control the repository uses. Defaults to Git. One of: `git`, `hg` (Mercurial), `svn` (Subversion), `bzr` (Bazaar), `cvs`, `tarball` (Tarball (a .tar.gz or .zip file)). Default: `git`.

**Outputs**

- `note` (text): Why the request was rejected or failed, when it says.
- `repository` (text): The repository to archive.
- `request_id` (number): The save request's number, for Get save request.
- `request_status` (text): accepted, rejected, or pending while Software Heritage checks an address it doesn't know.
- `requested_at` (text): When the request was made (ISO 8601, UTC).
- `snapshot_swhid` (text): The SWHID of the snapshot it took, once it has.
- `summary` (text): One line saying what was found.
- `task_status` (text): Where the archiving is: not created, pending, scheduled, running, succeeded or failed.
- `visit_date` (text): When the visit was made (ISO 8601, UTC).
- `visit_status` (text): How the visit ended, once it has: full, partial or failed.
- `visit_type` (text): Its kind: git, hg, svn, bzr, cvs or tarball.

**Example output**

```json
{
  "note": null,
  "repository": "https://github.com/rdicosmo/parmap",
  "request_id": 2607819,
  "request_status": "accepted",
  "requested_at": "2026-11-02T19:06:33.711966+00:00",
  "snapshot_swhid": null,
  "summary": "Save request 2607819 for https://github.com/rdicosmo/parmap: accepted, archiving pending.",
  "task_status": "pending",
  "visit_date": null,
  "visit_status": null,
  "visit_type": "git"
}
```

### Resolve SWHID

Check that a SWHID names something in the archive and get what it is, its repository, path and lines when it says, and its page.

**Inputs**

- SWHID (`swhid`, text, required): A SWHID, with or without qualifiers, e.g. swh:1:rev:9022bdc0...;origin=https://github.com/rdicosmo/parmap.

**Outputs**

- `anchor` (text): The commit or release it was reached from, when the SWHID says.
- `browse_url` (text): The archive's page for it.
- `lines` (text): The lines of a file it points at, e.g. 9-15, when it says.
- `object_id` (text): The id of what it names.
- `object_type` (text): What it names: file, folder, commit, release or snapshot.
- `origin` (text): The repository it was found in, when the SWHID says.
- `path` (text): Its path in that commit or release, when the SWHID says.
- `summary` (text): One line saying what was found.
- `swhid` (text): The SWHID without its qualifiers.
- `visit` (text): The snapshot SWHID of the visit, when the SWHID says.

**Example output**

```json
{
  "anchor": null,
  "browse_url": "https://archive.softwareheritage.org/browse/revision/9022bdc093f3540cede505084969311473adbb09/?origin_url=https://github.com/rdicosmo/parmap",
  "lines": null,
  "object_id": "9022bdc093f3540cede505084969311473adbb09",
  "object_type": "commit",
  "origin": "https://github.com/rdicosmo/parmap",
  "path": null,
  "summary": "swh:1:rev:9022bdc093f3540cede505084969311473adbb09 is an archived commit.",
  "swhid": "swh:1:rev:9022bdc093f3540cede505084969311473adbb09",
  "visit": null
}
```

### Search repositories

Find repositories in the archive whose address contains some text, e.g. a project or owner name, with how often and when the archive last visited each. Returns a page at a time.

**Inputs**

- Address contains (`text`, text, required): Text the repository's address contains, e.g. rdicosmo/parmap or parmap. Case doesn't matter.
- Only archived (`only_archived`, true/false): Only repositories the archive has visited at least once. Defaults to yes. Default: `true`.
- Visit type (`visit_type`, text): Only visits of this type, e.g. git. Get repository lists a repository's types. Leave blank for any.
- Most results (`limit`, number): How many repositories to return, from 1 to 1000. Defaults to 25. From 1 to 1000. Default: `25`.
- Next page (`page_token`, text): To read the next page, the Next page token the previous search returned. Leave blank for the first page.

**Outputs**

- `count` (number): How many repositories this page lists.
- `has_more` (true/false): True when there is another page.
- `next_page_token` (text): Give this as Next page to read the next page.
- `repositories` (list): The repositories found.
- `summary` (text): One line saying what was found.
- `text` (text): The text searched for.
- `total` (number): How many repositories match in all, when the archive says.

**Example output**

```json
{
  "count": 1,
  "has_more": true,
  "next_page_token": "gsQFc2NvcmXLQDDzrv9cbBLEBHNoYTHZKGUwMGNkMmM3N2E2NTBhNGY0ZGNmMWE3MDZjZmQ3Mjg0ZmRlODQ3N2I=",
  "repositories": [
    {
      "browse_url": "https://archive.softwareheritage.org/browse/origin/?origin_url=https://github.com/rdicosmo/parmap.git",
      "has_visits": true,
      "last_change_date": "2026-10-29T12:05:48.013317Z",
      "last_visit_date": "2026-10-31T11:56:50.187830+00:00",
      "snapshot_swhid": "swh:1:snp:6146f8cebe5245a915c21ad9186ddb0acecbd1bf",
      "url": "https://github.com/rdicosmo/parmap.git",
      "visit_count": 6,
      "visit_types": [
        "git"
      ]
    }
  ],
  "summary": "Found 1 archived repositories whose address contains 'rdicosmo/parmap'.",
  "text": "rdicosmo/parmap",
  "total": 8
}
```
