# Merdeka.com API

> Returns Merdeka.com articles: latest, by section, by keyword search, and full article text with byline and times.

Category: News & Media. Region: ID. 5 endpoints at `https://api.hoshime.com/v1/merdeka/<endpoint>`, `GET` with query parameters, answering `{data, meta}` (see https://hoshime.com/docs/responses.md). Reference: https://hoshime.com/docs/platforms/merdeka
## GET /v1/merdeka/latest

Latest articles of Merdeka.com, newest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `category` (string), `id` (string), `imageUrl` (string), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/merdeka/latest" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/merdeka/category

Latest articles of one section of Merdeka.com, newest first.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `category` | string | yes | Section of the site, such as peristiwa. (one of artis, dunia, gaya, oto, peristiwa, politik, sehat, sport, teknologi, uang; e.g. peristiwa) |
| `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: `author` (Author), `author.avatarUrl` (string), `author.id` (string), `author.name` (string), `author.url` (string), `author.username` (string), `category` (string), `id` (string), `imageUrl` (string), `publishedAt` (string), `source` (string), `summary` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/merdeka/category?category=peristiwa" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/merdeka/article

One article of Merdeka.com with its text, byline and times.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `url` | string | yes | Full address of an article of Merdeka.com. (e.g. https://www.merdeka.com/peristiwa/read/8330052/pasca-letusan-bromo-bpbd-rombak-jalur-evakuasi-dan-posko) |
| `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` (string), `content` (string), `image` (string), `publishedAt` (string), `section` (string), `summary` (string), `title` (string), `updatedAt` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/merdeka/article?url=https%3A%2F%2Fwww.merdeka.com%2Fperistiwa%2Fread%2F8330052%2Fpasca-letusan-bromo-bpbd-rombak-jalur-evakuasi-dan-posko" -H "Authorization: Bearer $HOSHIME_TOKEN"
```

## GET /v1/merdeka/search

Articles of Merdeka.com that match a keyword.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `query` | string | yes | Keyword to search for. (e.g. ekonomi) |
| `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: `image` (string), `title` (string), `url` (string)

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

## GET /v1/merdeka/tag

Articles of Merdeka.com filed under one tag, such as prabowo or prabowo-subianto, 30 per page; pages with cursor.

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

| Parameter | Type | Required | Description |
|---|---|---|---|
| `tag` | string | yes | Tag slug, such as prabowo or prabowo-subianto. (e.g. prabowo) |
| `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: `image` (string), `title` (string), `url` (string)

```bash
curl "https://api.hoshime.com/v1/merdeka/tag?tag=prabowo" -H "Authorization: Bearer $HOSHIME_TOKEN"
```
