# NuGet API

> Returns NuGet packages from search, with versions, descriptions, licences, dependencies and autocomplete suggestions.

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

NuGet packages matching a search, most relevant first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Words to search for, such as newtonsoft. (e.g. newtonsoft) |
| `limit` | integer | no | Items per page, 1 to 50. (default 10) |
| `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: `authors` (string[]), `description` (string), `id` (string), `projectUrl` (string), `tags` (string[]), `title` (string), `totalDownloads` (integer (int64)), `verified` (boolean), `version` (string)

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

## GET /v1/nuget/versions

Every published version of a NuGet package, lowest version first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Package id, such as Newtonsoft.Json. (e.g. Newtonsoft.Json) |
| `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: `id` (string), `items` (Version[]), `items[].version` (string)

```bash
curl "https://api.hoshime.com/v1/nuget/versions?id=Newtonsoft.Json" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nuget/package

The last version the NuGet registration lists for a package: description, license, dependencies by framework.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Package id, such as Newtonsoft.Json. (e.g. Newtonsoft.Json) |
| `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: `authors` (string), `dependencyGroups` (DependencyGroup[]), `dependencyGroups[].dependencies` (Dependency[]), `dependencyGroups[].targetFramework` (string), `description` (string), `id` (string), `isPrerelease` (boolean), `licenseExpression` (string), `listed` (boolean), `projectUrl` (string), `publishedAt` (string), `title` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/nuget/package?id=Newtonsoft.Json" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nuget/release

One version of a NuGet package: description, license, dependencies by framework.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Package id, such as Newtonsoft.Json. (e.g. Newtonsoft.Json) |
| `version` | string | yes | Version, such as 13.0.3. (e.g. 13.0.3) |
| `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: `authors` (string), `dependencyGroups` (DependencyGroup[]), `dependencyGroups[].dependencies` (Dependency[]), `dependencyGroups[].targetFramework` (string), `description` (string), `id` (string), `isPrerelease` (boolean), `licenseExpression` (string), `listed` (boolean), `projectUrl` (string), `publishedAt` (string), `title` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/nuget/release?id=Newtonsoft.Json&version=13.0.3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nuget/readme

The README of one version of a NuGet package, as Markdown.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `id` | string | yes | Package id, such as Newtonsoft.Json. (e.g. Newtonsoft.Json) |
| `version` | string | yes | Version, such as 13.0.3. (e.g. 13.0.3) |
| `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: `id` (string), `markdown` (string), `version` (string)

```bash
curl "https://api.hoshime.com/v1/nuget/readme?id=Newtonsoft.Json&version=13.0.3" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/nuget/suggest

Package ids that start with the text, for an autocomplete box.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | The start of a package id, such as newton. (e.g. newton) |
| `limit` | integer | no | Items per page, 1 to 50. (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: `id` (string)

```bash
curl "https://api.hoshime.com/v1/nuget/suggest?query=newton" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
