# Bing API

> Returns Bing web search results for a query, 10 per page with titles, links, snippets and display urls, and Bing News articles for a query, from the RSS feeds of its public result pages.

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

Bing web search results for a query, 10 per page, in rank order.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms, such as golang generics. (e.g. golang generics) |
| `market` | string | no | Market of the results, such as en-US or id-ID. Omit it for Bing's default. |
| `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: `displayUrl` (string), `position` (any), `snippet` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/bing/search?query=golang+generics" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/bing/news

Bing News articles for a query, 10 per page, newest first as Bing ranks them.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Search terms, such as indonesia. (e.g. indonesia) |
| `market` | string | no | Market of the articles, such as en-US or id-ID. Omit it for Bing's default. |
| `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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `id` (string), `imageUrl` (string), `position` (any), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/bing/news?query=indonesia" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
