# Maven Central API

> Returns Maven Central artifacts, their versions, group listings, POM details and artifacts containing a given class.

Category: Developer & Tech. Region: global. 5 endpoints at `https://api.hoshime.com/v1/maven/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/maven
## GET /v1/maven/search

Maven Central artifacts matching a search, with their latest version.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as guava. (e.g. guava) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `artifactId` (string), `groupId` (string), `id` (string), `latestVersion` (string), `packaging` (string), `updatedAt` (string), `versionCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/maven/search?query=guava" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/maven/versions

The published versions of one Maven artifact.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `group` | string | yes | Group id, such as com.google.guava. (e.g. com.google.guava) |
| `artifact` | string | yes | Artifact id, such as guava. (e.g. guava) |
| `limit` | integer | no | Items per page, 1 to 100. (default 20) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `artifactId` (string), `groupId` (string), `packaging` (string), `publishedAt` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/maven/versions?group=com.google.guava&artifact=guava" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/maven/group

The artifacts of one group id, in search order. Page with cursor.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `group` | string | yes | Group id, such as com.google.guava. (e.g. com.google.guava) |
| `limit` | integer | no | Items per page, 1 to 100. (default 20) |
| `cursor` | string | no | meta.pagination.nextCursor of the previous page. Omit it for the first page. |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `artifactId` (string), `groupId` (string), `id` (string), `latestVersion` (string), `packaging` (string), `updatedAt` (string), `versionCount` (integer (int64))

```bash
curl "https://api.hoshime.com/v1/maven/group?group=com.google.guava" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/maven/pom

The project description of one Maven artifact version: name, license and dependencies, from its POM file.

Scope: `social:read` · Units: 1 · Cached: 1440 min

| Parameter | Type | Required | Description |
|---|---|---|---|
| `group` | string | yes | Group id, such as com.google.guava. (e.g. com.google.guava) |
| `artifact` | string | yes | Artifact id, such as guava. (e.g. guava) |
| `version` | string | yes | Version, such as 33.4.0-jre. (e.g. 33.4.0-jre) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `artifactId` (string), `dependencies` (Dependency[]), `dependencies[].artifactId` (string), `dependencies[].groupId` (string), `dependencies[].optional` (boolean), `dependencies[].scope` (string), `dependencies[].version` (string), `description` (string), `groupId` (string), `licenses` (License[]), `licenses[].name` (string), `licenses[].url` (string), `name` (string), `packaging` (string), `url` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/maven/pom?group=com.google.guava&artifact=guava&version=33.4.0-jre" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/maven/classes

Maven Central artifacts that contain a class, found by its fully qualified name.

Scope: `social:read` · Units: 1 · Cached: 30 min · Paginated: cursor

| Parameter | Type | Required | Description |
|---|---|---|---|
| `class` | string | yes | Fully qualified class name, such as com.google.common.base.Preconditions. (e.g. com.google.common.base.Preconditions) |
| `limit` | integer | no | Items per page, 1 to 100. (default 10) |
| `tunnel` | string | no | Id or name of one of your tunnels: the call reads the source from the machine that runs `hoshime tunnel`, through its own connection. Fails with 409 tunnel_unavailable when no machine is connected. Cannot be combined with proxy. |
| `proxy` | string | no | Your own http:// or https:// proxy, such as http://user:pass@proxy.example.com:8080, on a public address. The call reads the source only through it. |
| `profileId` | string | no | Browser profile whose login the call sends (its cookies), so the source answers as that account. Without tunnel or proxy it leaves through the profile's own residential IP. Needs the browser:read scope. Data read logged in is for your account only. |

Response data fields: `artifactId` (string), `groupId` (string), `id` (string), `packaging` (string), `publishedAt` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/maven/classes?class=com.google.common.base.Preconditions" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
