# Maven Central

> Read the Java and JVM package registry from a workflow. Search every library on Maven Central by name, namespace, packaging, tag or release date, get any library's current version and full version history, and read a release's POM for its licence, developers, source repository and dependencies. Find which artifact contains a given Java class, identify an unlabelled jar from its SHA-1, and get the direct download URL, size and checksums of any published file. It also watches your own releases on the Central Portal: whether a version number has already been used, how a deployment your build uploaded is progressing through validation, and what is inside one before it goes out. Every action reads: nothing here uploads, releases or discards anything on Maven Central.

App · Code Repositories · 12 actions. Web page: https://docs.lodol.com/docs/integrations/maven-central

## Actions

### Check whether a version is published

Ask the Central Portal whether a version is already out. Maven Central never lets a published version be replaced, so this is the check to run before a release goes out: if the answer is yes, the version number has to go up. Answers immediately, without waiting for the search index to catch up. Reads only, and only about your own namespaces.

**Inputs**

- Namespace (`namespace`, text, required): Your verified namespace on the Central Portal: the group ID you publish under.
- Artifact name (`name`, text, required): The artifact ID being released.
- Version (`version`, text, required): The version about to be released.

**Outputs**

- `coordinates` (text): The three together.
- `name` (text): The artifact that was asked about.
- `namespace` (text): The namespace that was asked about.
- `published` (true/false): True when that version is already on Maven Central.
- `url` (text): Where that version would appear on Maven Central.
- `version` (text): The version that was asked about.
- `version_number_available` (true/false): The same answer the other way round: true when the version number is still free for a release to use.

**Example output**

```json
{
  "coordinates": "com.example.library:example-library:1.2.0",
  "name": "example-library",
  "namespace": "com.example.library",
  "published": false,
  "url": "https://central.sonatype.com/artifact/com.example.library/example-library/1.2.0",
  "version": "1.2.0",
  "version_number_available": true
}
```

### Find artifacts by class name

Find which releases on Maven Central contain a given Java class, by its simple name or its fully qualified one. The action for a ClassNotFoundException or a NoClassDefFoundError: it answers 'which dependency do I need for this class?'.

**Inputs**

- Class name (`class_name`, text, required): The class to look for. Match it as a simple name or a fully qualified one using the setting below.
- Match (`match`, text): How to read the class name above. A fully qualified name finds far fewer, more exact results. One of: `simple` (Simple name - just the class, e.g. Gson), `full` (Fully qualified name - package and class, e.g. com.google.gson.Gson). Default: `simple`.
- Page (`page`, number): Which page of results to return. Starts at 1. From 1 to 10000. Default: `1`.
- Results per page (`per_page`, number): How many results to return, up to 200. From 1 to 200. Default: `20`.

**Outputs**

- `class_name` (text): The class that was searched for.
- `count` (number): How many results are on this page.
- `has_more` (true/false): True when there is another page after this one.
- `match` (text): How the name was matched: 'simple' or 'full'.
- `next_page` (number): The next page number, or null on the last page.
- `page` (number): The page this is.
- `per_page` (number): How many results were asked for per page.
- `total_count` (number): How many results there are in total.
- `versions` (list): The releases that contain it.

**Example output**

```json
{
  "class_name": "com.google.gson.Gson",
  "count": 1,
  "has_more": true,
  "match": "full",
  "next_page": 2,
  "page": 1,
  "per_page": 20,
  "total_count": 41,
  "versions": [
    {
      "artifact_id": "gson",
      "classifiers": [
        "sources",
        "javadoc"
      ],
      "coordinates": "com.google.code.gson:gson:2.11.0",
      "files": [
        {
          "classifier": null,
          "extension": "jar",
          "file_name": "gson-2.11.0.jar",
          "suffix": ".jar"
        },
        {
          "classifier": "sources",
          "extension": "jar",
          "file_name": "gson-2.11.0-sources.jar",
          "suffix": "-sources.jar"
        },
        {
          "classifier": null,
          "extension": "pom",
          "file_name": "gson-2.11.0.pom",
          "suffix": ".pom"
        }
      ],
      "group_id": "com.google.code.gson",
      "packaging": "jar",
      "published": "2024-05-20T16:26:47Z",
      "published_millis": 1716222407000,
      "tags": [
        "gson",
        "json",
        "library"
      ],
      "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson/2.11.0",
      "version": "2.11.0"
    }
  ]
}
```

### Get a deployment

Check where a deployment has got to: still validating, waiting for someone to release it, on its way to Maven Central, out, or failed with the reasons why. Also lists the components it contains. Point it at a deployment your build uploaded and a workflow can watch a release land, or raise an alert when validation fails or a release sits waiting. Reads only: it never releases or discards anything, and only reads your own deployments.

**Inputs**

- Deployment ID (`deployment_id`, text, required): The id the Central Portal gave the deployment when your build uploaded it. It is in the URL of the deployment's page under Publishing, and every publishing tool prints it.

**Outputs**

- `awaiting_release` (true/false): True when it has passed validation and is sitting waiting for someone to release it in the Central Portal: the state worth alerting on, because a release stops here until a person acts.
- `can_discard` (true/false): True when the Central Portal would let you discard it. Nothing here discards anything; this reports what the Portal offers.
- `deployment_id` (text): The deployment's id, which every other release action takes.
- `deployment_name` (text): The human-readable name it was uploaded under, which defaults to the bundle's filename.
- `errors` (list): What validation objected to. Empty unless the state is FAILED.
- `is_failed` (true/false): True when validation rejected it; the errors say why.
- `is_published` (true/false): True once it is on Maven Central.
- `package_urls` (list): A package URL per component in the deployment, e.g. 'pkg:maven/com.example/library@1.0.0'.
- `state` (text): Where it has got to: PENDING, VALIDATING, VALIDATED, PUBLISHING, PUBLISHED or FAILED.
- `state_description` (text): What that state means, in a sentence.
- `url` (text): The Portal's deployments page.

**Example output**

```json
{
  "awaiting_release": true,
  "can_discard": true,
  "deployment_id": "28570f16-da32-4c14-bd2e-c1acc0782365",
  "deployment_name": "central-bundle.zip",
  "errors": [],
  "is_failed": false,
  "is_published": false,
  "package_urls": [
    "pkg:maven/com.example.library/example@1.2.0"
  ],
  "state": "VALIDATED",
  "state_description": "It passed validation. A user-managed deployment stops here until someone publishes it.",
  "url": "https://central.sonatype.com/publishing/deployments"
}
```

### Get a file from a deployment

Read a file out of a deployment that has passed validation but has not been released, so a release candidate can be checked before it goes out. Text files such as the POM come back as text; anything else comes back as its size, type and SHA-1. Give a deployment ID to look inside that one deployment, or leave it blank to take the file from whichever validated deployment has it. Reads only, and only about your own deployments.

**Inputs**

- File path (`file_path`, text, required): The file's path inside the deployment, laid out as a Maven repository: the group ID with slashes instead of dots, then the artifact ID, the version and the filename.
- Deployment ID (`deployment_id`, text): Optional. Which deployment to read from. Leave blank to take the file from whichever validated deployment has it.
- Most characters to return (`max_characters`, number): Optional. How much of a text file to return. Up to 200,000. From 1 to 200000. Default: `20000`.

**Outputs**

- `content` (text): The file's text, when it is a text file.
- `content_truncated` (true/false): True when the text was cut short.
- `content_type` (text): What the Portal served it as.
- `deployment_id` (text): The deployment it came from, or null when any validated deployment was allowed to supply it.
- `file_name` (text): Just the filename.
- `file_path` (text): The path that was read.
- `is_text` (true/false): True when the file was returned as text. Jars and other archives are not.
- `sha1` (text): The SHA-1 of what was downloaded, for comparing against what is already on Maven Central.
- `size_bytes` (number): How big the file is.
- `url` (text): The Portal's deployments page.

**Example output**

```json
{
  "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project>\u2026</project>",
  "content_truncated": false,
  "content_type": "application/xml",
  "deployment_id": "28570f16-da32-4c14-bd2e-c1acc0782365",
  "file_name": "example-library-1.2.0.pom",
  "file_path": "com/example/library/example-library/1.2.0/example-library-1.2.0.pom",
  "is_text": true,
  "sha1": "9c1185a5c5e9fc54612808977ee8f548b2258d31",
  "size_bytes": 2841,
  "url": "https://central.sonatype.com/publishing/deployments"
}
```

### Get a file's download URL

Find one published file (the jar, the sources jar, the javadoc jar, the POM) and hand back its direct download URL, its size, when it was last modified and its SHA-1 and MD5 checksums. Pick the file from a list of what the release actually published. Hands back the URL rather than the file itself, for a later step to download.

**Inputs**

- Group ID (`group_id`, text, required): The publisher's namespace, spelled with dots: the first half of a Maven coordinate.
- Artifact ID (`artifact_id`, text, required): The library's own name: the second half of a Maven coordinate.
- Version (`version`, text, required): Which release. Pick one from the list, newest first.
- File (`file`, text): Optional. Which of the release's files to locate: the list is what this exact release published. Leave it alone to take the main jar, or use the two fields below instead.
- Extension (`extension`, text): Optional. The file's extension, when it is not being picked from the list above. Defaults to 'jar'.
- Classifier (`classifier`, text): Optional. The file's classifier, when it is not being picked from the list above. Leave blank for the main artifact.
- Include checksums (`include_checksums`, true/false): Optional. Also fetch the file's SHA-1 and MD5, which costs two extra requests. On by default, because a download URL without a checksum is hard to verify. Default: `true`.

**Outputs**

- `artifact_id` (text): The artifact that was asked about.
- `classifier` (text): The classifier, or null for the main artifact.
- `content_type` (text): What the repository serves it as.
- `coordinates` (text): The full coordinate.
- `download_url` (text): The direct URL of the file, for a later step to download.
- `extension` (text): The file's extension.
- `file_name` (text): The file's name in the repository.
- `file_path` (text): Its path within the repository, which is the 'filepath' the remote-content endpoint takes.
- `group_id` (text): The namespace that was asked about.
- `last_modified` (text): When the repository last wrote it.
- `md5` (text): Its MD5, when checksums were asked for.
- `remote_content_url` (text): The same file through Maven Central's documented remote-content endpoint, which redirects to the direct URL.
- `sha1` (text): Its SHA-1, when checksums were asked for. This is what 'Identify a file by checksum' takes.
- `size_bytes` (number): How big the file is.
- `url` (text): The release's page on Maven Central.
- `version` (text): The version that was asked about.

**Example output**

```json
{
  "artifact_id": "gson",
  "classifier": null,
  "content_type": "application/java-archive",
  "coordinates": "com.google.code.gson:gson:2.11.0",
  "download_url": "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.11.0/gson-2.11.0.jar",
  "extension": "jar",
  "file_name": "gson-2.11.0.jar",
  "file_path": "com/google/code/gson/gson/2.11.0/gson-2.11.0.jar",
  "group_id": "com.google.code.gson",
  "last_modified": "Mon, 20 May 2024 16:26:47 GMT",
  "md5": "8b1e1e1a3b1b6e3ef2b1a4b8f9d0e7c2",
  "remote_content_url": "https://search.maven.org/remotecontent?filepath=com/google/code/gson/gson/2.11.0/gson-2.11.0.jar",
  "sha1": "527175ca6d81050b53bdd4c457a6d6e017626b0e",
  "size_bytes": 298435,
  "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson/2.11.0",
  "version": "2.11.0"
}
```

### Get a POM

Read a release's POM and hand it back already parsed: the project's name and description, its licence, its source repository, its developers, its parent, everything it depends on and every version it manages. The action for licence audits and dependency reviews.

**Inputs**

- Group ID (`group_id`, text, required): The publisher's namespace, spelled with dots: the first half of a Maven coordinate.
- Artifact ID (`artifact_id`, text, required): The library's own name: the second half of a Maven coordinate.
- Version (`version`, text, required): Which release. Pick one from the list, newest first.
- Include the raw XML (`include_raw_xml`, true/false): Optional. Also return the POM's own XML text. Off by default, because the parsed fields above are usually what a workflow wants. Default: `false`.
- Most characters of raw XML (`max_characters`, number): Optional. How much of the raw XML to return when it is included. Up to 200,000. From 1 to 200000. Default: `20000`.

**Outputs**

- `artifact_id` (text): The artifact's name.
- `coordinates` (text): The full coordinate that was asked for.
- `dependencies` (list): What this release depends on. A null version means the parent's dependency management pins it.
- `description` (text): What the project says it is. Null when it says nothing.
- `developers` (list): The people the POM lists as maintainers.
- `group_id` (text): The namespace, taken from the parent when the POM leaves it out.
- `inception_year` (text): The year the project says it started.
- `licenses` (list): The licences it is published under.
- `managed_dependencies` (list): Versions this POM pins for anything that inherits from it: what a BOM is made of.
- `modules` (list): The sub-projects it builds, when it is an aggregator.
- `name` (text): The project's display name.
- `organization` (object): The organisation behind it, if the POM names one.
- `packaging` (text): What it publishes as. 'jar' unless the POM says otherwise.
- `parent` (object): The POM this one inherits from, if any. A missing licence or SCM here is usually on the parent.
- `pom_url` (text): The .pom file this was read from.
- `project_url` (text): The project's own website.
- `properties` (object): The POM's own properties, which is where projects keep their dependency versions.
- `raw_xml` (text): The POM's XML text, when it was asked for. Null otherwise.
- `raw_xml_truncated` (true/false): True when the raw XML was cut short.
- `scm` (object): Where the source lives, if the POM says.
- `url` (text): The release's page on Maven Central.
- `version` (text): The version, taken from the parent when the POM leaves it out.

**Example output**

```json
{
  "artifact_id": "gson",
  "coordinates": "com.google.code.gson:gson:2.11.0",
  "dependencies": [
    {
      "artifact_id": "error_prone_annotations",
      "classifier": null,
      "group_id": "com.google.errorprone",
      "optional": true,
      "scope": "compile",
      "type": "jar",
      "version": "2.27.0"
    }
  ],
  "description": "Gson JSON library, a Java serialization/deserialization library to convert Java Objects into JSON and back",
  "developers": [
    {
      "email": null,
      "id": null,
      "name": "Google Inc.",
      "organization": null,
      "url": null
    }
  ],
  "group_id": "com.google.code.gson",
  "inception_year": "2008",
  "licenses": [
    {
      "distribution": "repo",
      "name": "Apache-2.0",
      "url": "https://www.apache.org/licenses/LICENSE-2.0.txt"
    }
  ],
  "managed_dependencies": [],
  "modules": [],
  "name": "Gson",
  "organization": {
    "name": "Google, Inc.",
    "url": "https://www.google.com"
  },
  "packaging": "jar",
  "parent": {
    "artifact_id": "gson-parent",
    "group_id": "com.google.code.gson",
    "version": "2.11.0"
  },
  "pom_url": "https://repo1.maven.org/maven2/com/google/code/gson/gson/2.11.0/gson-2.11.0.pom",
  "project_url": "https://github.com/google/gson",
  "properties": {
    "maven.compiler.release": "8"
  },
  "raw_xml": null,
  "raw_xml_truncated": false,
  "scm": {
    "connection": "scm:git:https://github.com/google/gson.git",
    "developer_connection": "scm:git:git@github.com:google/gson.git",
    "tag": "gson-parent-2.11.0",
    "url": "https://github.com/google/gson/gson"
  },
  "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson/2.11.0",
  "version": "2.11.0"
}
```

### Get a version

Get one exact release: when it was published, what it publishes as, and every file it shipped (the main jar, the sources jar, the javadoc jar and anything else), with the classifier and extension needed to fetch each.

**Inputs**

- Group ID (`group_id`, text, required): The publisher's namespace, spelled with dots: the first half of a Maven coordinate.
- Artifact ID (`artifact_id`, text, required): The library's own name: the second half of a Maven coordinate.
- Version (`version`, text, required): Which release. Pick one from the list, newest first.

**Outputs**: One exact release of a library.

- `artifact_id` (text): The library's own name.
- `classifiers` (list): The classifiers it published, e.g. 'sources' and 'javadoc'.
- `coordinates` (text): The full coordinate, spelled 'group:artifact:version': what goes in a build file.
- `files` (list): Every file this release published, with the classifier and extension needed to fetch one.
- `group_id` (text): The publisher's namespace.
- `packaging` (text): What this release publishes: 'jar', 'pom', 'aar' and so on.
- `published` (text): When it was published, as an ISO 8601 UTC instant.
- `published_millis` (number): The same moment as an epoch-millisecond number.
- `tags` (list): Words the search index derived from the project's own description. Empty for many releases.
- `url` (text): This release's page on Maven Central.
- `version` (text): The exact version.

**Example output**

```json
{
  "artifact_id": "gson",
  "classifiers": [
    "sources",
    "javadoc"
  ],
  "coordinates": "com.google.code.gson:gson:2.11.0",
  "files": [
    {
      "classifier": null,
      "extension": "jar",
      "file_name": "gson-2.11.0.jar",
      "suffix": ".jar"
    },
    {
      "classifier": "sources",
      "extension": "jar",
      "file_name": "gson-2.11.0-sources.jar",
      "suffix": "-sources.jar"
    },
    {
      "classifier": null,
      "extension": "pom",
      "file_name": "gson-2.11.0.pom",
      "suffix": ".pom"
    }
  ],
  "group_id": "com.google.code.gson",
  "packaging": "jar",
  "published": "2024-05-20T16:26:47Z",
  "published_millis": 1716222407000,
  "tags": [
    "gson",
    "json",
    "library"
  ],
  "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson/2.11.0",
  "version": "2.11.0"
}
```

### Get the latest version

Get the current version of one library, ready to paste into a build file, plus when it was released and how many versions there have been. The action for 'is our dependency out of date?'.

**Inputs**

- Group ID (`group_id`, text, required): The publisher's namespace, spelled with dots: the first half of a Maven coordinate.
- Artifact ID (`artifact_id`, text, required): The library's own name: the second half of a Maven coordinate.

**Outputs**

- `artifact_id` (text): The library's own name, e.g. 'gson'.
- `coordinates` (text): Group and artifact together, spelled 'group:artifact'.
- `dependency_coordinates` (text): The full coordinate of the latest release, spelled 'group:artifact:version': what goes in a build file.
- `group_id` (text): The publisher's namespace, e.g. 'com.google.code.gson'.
- `last_published` (text): When its newest version was published, as an ISO 8601 UTC instant.
- `last_published_millis` (number): The same moment as the epoch-millisecond number the search index stores, which is what a 'released after' filter compares against.
- `latest_version` (text): The newest version the search index has for it: the one to depend on.
- `packaging` (text): What it publishes: 'jar', 'pom', 'aar' and so on.
- `url` (text): Its page on Maven Central.
- `version_count` (number): How many versions it has published in total.

**Example output**

```json
{
  "artifact_id": "gson",
  "coordinates": "com.google.code.gson:gson",
  "dependency_coordinates": "com.google.code.gson:gson:2.11.0",
  "group_id": "com.google.code.gson",
  "last_published": "2024-05-20T16:26:47Z",
  "last_published_millis": 1716222407000,
  "latest_version": "2.11.0",
  "packaging": "jar",
  "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson",
  "version_count": 34
}
```

### Get version metadata

Read an artifact's maven-metadata.xml straight from the repository: every version it has ever published in one list, which one Maven treats as the current release, and when the list last changed. This is the repository's own record, so it is the one to trust when the search index has not caught up with a release yet.

**Inputs**

- Group ID (`group_id`, text, required): The publisher's namespace, spelled with dots: the first half of a Maven coordinate.
- Artifact ID (`artifact_id`, text, required): The library's own name: the second half of a Maven coordinate.

**Outputs**

- `artifact_id` (text): The artifact, as the metadata file records it.
- `coordinates` (text): Group and artifact together.
- `group_id` (text): The namespace, as the metadata file records it.
- `last_updated` (text): When the metadata last changed, as an ISO 8601 UTC instant.
- `latest_version` (text): The newest version in the file, which can be a pre-release.
- `metadata_url` (text): The maven-metadata.xml this was read from.
- `release_version` (text): The newest non-pre-release version: what Maven resolves 'RELEASE' to.
- `url` (text): The artifact's page on Maven Central.
- `version_count` (number): How many versions that is.
- `versions` (list): Every version, oldest first, as the file lists them.

**Example output**

```json
{
  "artifact_id": "gson",
  "coordinates": "com.google.code.gson:gson",
  "group_id": "com.google.code.gson",
  "last_updated": "2024-05-20T16:31:12Z",
  "latest_version": "2.11.0",
  "metadata_url": "https://repo1.maven.org/maven2/com/google/code/gson/gson/maven-metadata.xml",
  "release_version": "2.11.0",
  "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson",
  "version_count": 3,
  "versions": [
    "2.10",
    "2.10.1",
    "2.11.0"
  ]
}
```

### Identify a file by checksum

Identify an unlabelled jar from its SHA-1: given the checksum, say exactly which release on Maven Central it is. The action for auditing a lib/ directory or verifying that a file really is the release it claims to be.

**Inputs**

- SHA-1 checksum (`sha1`, text, required): The file's SHA-1, as 40 hex characters. It is what the '.sha1' file next to a jar in the repository contains, and what 'Get a file's download URL' returns.

**Outputs**

- `found` (true/false): True when Maven Central recognises the file. False means it is not a Central release: a locally built or repackaged jar, for instance.
- `match` (object): The release the checksum belongs to, or null when there is none.
- `matches` (list): Every release with that checksum. More than one means the same bytes were published twice.
- `sha1` (text): The checksum that was looked up, lowercased.

**Example output**

```json
{
  "found": true,
  "match": {
    "artifact_id": "gson",
    "classifiers": [
      "sources",
      "javadoc"
    ],
    "coordinates": "com.google.code.gson:gson:2.11.0",
    "files": [
      {
        "classifier": null,
        "extension": "jar",
        "file_name": "gson-2.11.0.jar",
        "suffix": ".jar"
      },
      {
        "classifier": "sources",
        "extension": "jar",
        "file_name": "gson-2.11.0-sources.jar",
        "suffix": "-sources.jar"
      },
      {
        "classifier": null,
        "extension": "pom",
        "file_name": "gson-2.11.0.pom",
        "suffix": ".pom"
      }
    ],
    "group_id": "com.google.code.gson",
    "packaging": "jar",
    "published": "2024-05-20T16:26:47Z",
    "published_millis": 1716222407000,
    "tags": [
      "gson",
      "json",
      "library"
    ],
    "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson/2.11.0",
    "version": "2.11.0"
  },
  "matches": [
    {
      "artifact_id": "gson",
      "classifiers": [
        "sources",
        "javadoc"
      ],
      "coordinates": "com.google.code.gson:gson:2.11.0",
      "files": [
        {
          "classifier": null,
          "extension": "jar",
          "file_name": "gson-2.11.0.jar",
          "suffix": ".jar"
        },
        {
          "classifier": "sources",
          "extension": "jar",
          "file_name": "gson-2.11.0-sources.jar",
          "suffix": "-sources.jar"
        },
        {
          "classifier": null,
          "extension": "pom",
          "file_name": "gson-2.11.0.pom",
          "suffix": ".pom"
        }
      ],
      "group_id": "com.google.code.gson",
      "packaging": "jar",
      "published": "2024-05-20T16:26:47Z",
      "published_millis": 1716222407000,
      "tags": [
        "gson",
        "json",
        "library"
      ],
      "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson/2.11.0",
      "version": "2.11.0"
    }
  ],
  "sha1": "527175ca6d81050b53bdd4c457a6d6e017626b0e"
}
```

### List versions

List every release of one library, newest first, with the date each went out and the files each published. Filter to a date range to see only what shipped since a given moment.

**Inputs**

- Group ID (`group_id`, text, required): The publisher's namespace, spelled with dots: the first half of a Maven coordinate.
- Artifact ID (`artifact_id`, text, required): The library's own name: the second half of a Maven coordinate.
- Packaging (`packaging`, text): Optional. Only artifacts published as this kind of thing. Most are 'jar'; a parent or a BOM is 'pom', an Android library is 'aar'.
- Classifier (`classifier`, text): Optional. Only artifacts that also publish this extra file: 'sources' and 'javadoc' are the usual ones.
- Released after (`published_after`, date and time): Optional. Only releases published at or after this moment. Pick it from the calendar; it is converted to what the search index wants.
- Released before (`published_before`, date and time): Optional. Only releases published at or before this moment. Pick it from the calendar; it is converted to what the search index wants.
- Page (`page`, number): Which page of results to return. Starts at 1. From 1 to 10000. Default: `1`.
- Results per page (`per_page`, number): How many results to return, up to 200. From 1 to 200. Default: `20`.

**Outputs**

- `artifact_id` (text): The artifact that was asked about.
- `coordinates` (text): Group and artifact together.
- `count` (number): How many results are on this page.
- `group_id` (text): The namespace that was asked about.
- `has_more` (true/false): True when there is another page after this one.
- `next_page` (number): The next page number, or null on the last page.
- `page` (number): The page this is.
- `per_page` (number): How many results were asked for per page.
- `total_count` (number): How many results there are in total.
- `url` (text): The artifact's page on Maven Central.
- `versions` (list): The releases on this page, newest first.

**Example output**

```json
{
  "artifact_id": "gson",
  "coordinates": "com.google.code.gson:gson",
  "count": 1,
  "group_id": "com.google.code.gson",
  "has_more": true,
  "next_page": 2,
  "page": 1,
  "per_page": 20,
  "total_count": 34,
  "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson",
  "versions": [
    {
      "artifact_id": "gson",
      "classifiers": [
        "sources",
        "javadoc"
      ],
      "coordinates": "com.google.code.gson:gson:2.11.0",
      "files": [
        {
          "classifier": null,
          "extension": "jar",
          "file_name": "gson-2.11.0.jar",
          "suffix": ".jar"
        },
        {
          "classifier": "sources",
          "extension": "jar",
          "file_name": "gson-2.11.0-sources.jar",
          "suffix": "-sources.jar"
        },
        {
          "classifier": null,
          "extension": "pom",
          "file_name": "gson-2.11.0.pom",
          "suffix": ".pom"
        }
      ],
      "group_id": "com.google.code.gson",
      "packaging": "jar",
      "published": "2024-05-20T16:26:47Z",
      "published_millis": 1716222407000,
      "tags": [
        "gson",
        "json",
        "library"
      ],
      "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson/2.11.0",
      "version": "2.11.0"
    }
  ]
}
```

### Search artifacts

Search Maven Central for Java and JVM libraries by name, by publisher namespace, by what they publish, or by when they were last released. Returns one row per library with its latest version, so it answers 'what is there for X?' and 'what has this namespace released?'.

**Inputs**

- Search text (`query`, text): Optional. What to search for. Maven Central matches group ids, artifact ids and project text. Leave blank to browse with the filters below instead.
- Group ID (`group_id`, text): Optional. Only artifacts in this namespace, matched exactly.
- Artifact ID (`artifact_id`, text): Optional. Only artifacts with this name, matched exactly across every namespace that publishes one.
- Packaging (`packaging`, text): Optional. Only artifacts published as this kind of thing. Most are 'jar'; a parent or a BOM is 'pom', an Android library is 'aar'.
- Classifier (`classifier`, text): Optional. Only artifacts that also publish this extra file: 'sources' and 'javadoc' are the usual ones.
- Tag (`tag`, text): Optional. Only artifacts the index tagged with this word. Tags come from each project's own description.
- Released after (`published_after`, date and time): Optional. Only releases published at or after this moment. Pick it from the calendar; it is converted to what the search index wants.
- Released before (`published_before`, date and time): Optional. Only releases published at or before this moment. Pick it from the calendar; it is converted to what the search index wants.
- Page (`page`, number): Which page of results to return. Starts at 1. From 1 to 10000. Default: `1`.
- Results per page (`per_page`, number): How many results to return, up to 200. From 1 to 200. Default: `20`.

**Outputs**

- `artifacts` (list): The libraries on this page.
- `count` (number): How many results are on this page.
- `filters` (object): The filters that were applied.
- `has_more` (true/false): True when there is another page after this one.
- `next_page` (number): The next page number, or null on the last page.
- `page` (number): The page this is.
- `per_page` (number): How many results were asked for per page.
- `query` (text): The text that was searched for, if any.
- `total_count` (number): How many results there are in total.

**Example output**

```json
{
  "artifacts": [
    {
      "artifact_id": "gson",
      "coordinates": "com.google.code.gson:gson",
      "group_id": "com.google.code.gson",
      "last_published": "2024-05-20T16:26:47Z",
      "last_published_millis": 1716222407000,
      "latest_version": "2.11.0",
      "packaging": "jar",
      "url": "https://central.sonatype.com/artifact/com.google.code.gson/gson",
      "version_count": 34
    }
  ],
  "count": 1,
  "filters": {
    "artifact_id": null,
    "classifier": null,
    "group_id": null,
    "packaging": null,
    "published_after": null,
    "published_before": null,
    "tag": null
  },
  "has_more": true,
  "next_page": 2,
  "page": 1,
  "per_page": 20,
  "query": "json",
  "total_count": 4127
}
```
