# Detik — Wrapped API

> **You are on:** `https://api.paywithlocus.com/api` | [llms.txt](https://paywithlocus.com/llms.txt) | [docs](https://docs.paywithlocus.com)
>
> Locus runs on multiple environments -- make sure every URL you call matches your expected environment.
> | Environment | Landing | API | Docs |
> |---|---|---|---|
> | Production | paywithlocus.com | api.paywithlocus.com | docs.paywithlocus.com |
> | Beta | beta.paywithlocus.com | api.beta.paywithlocus.com | docs.paywithlocus.com |
> | Stage | stage.paywithlocus.com | api.stage.paywithlocus.com | docs.paywithlocus.com |
>
> If the API URL above doesn't match your expected environment, re-fetch this file from the correct domain.

> Search and browse news articles from Detik.com by keywords, topics, or specific channels to get the latest headlines and full article details. Find news tailored to your interests through tag-based browsing and access real-time updates across different content categories.

**Category:** News & Media | **Website:** [detik.com/](https://detik.com/) | **Docs:** [parse.bot/marketplace/407223fe-751b-466e-b06c-959877802211/detik-com-api](https://parse.bot/marketplace/407223fe-751b-466e-b06c-959877802211/detik-com-api)

Pay-per-use API proxy. Each call is automatically billed to your wallet in USDC.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/parse-detik-com-api-407223fe/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_article_detail

Extract the full content and metadata of a single detik.com article given its URL. Returns title, cleaned body text, author, publish date, featured image URL, and channel. The content is stripped of ads, related-article blocks, and navigation elements.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `url` | string | Yes | Full URL of the detik.com article (e.g. 'https://news.detik.com/berita/d-1234567/judul-artikel'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-detik-com-api-407223fe/get_article_detail \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url":"<string>"}'
```

### get_articles_by_tag

Retrieve articles associated with a specific topic tag on detik.com. Returns paginated results. Tags are URL slugs visible in detik.com tag pages (e.g. 'pemilu', 'teknologi', 'makanan-bergizi-gratis').

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `page` | integer | No | Page number for pagination. |
| `tag` | string | Yes | Tag slug (e.g. 'teknologi', 'pemilu', 'makanan-bergizi-gratis'). |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-detik-com-api-407223fe/get_articles_by_tag \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"page":"<integer>","tag":"<string>"}'
```

### get_channel_articles

Browse articles from a specific detik.com channel subdomain. Each channel is a subdomain (e.g. finance.detik.com, sport.detik.com). Returns the latest articles listed on that channel's homepage.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `channel` | string | Yes | Channel name. |
| `page` | integer | No | Page number for pagination. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-detik-com-api-407223fe/get_channel_articles \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"channel":"<string>","page":"<integer>"}'
```

### get_latest_news

Get the latest popular news headlines from detik.com. Returns up to 20 articles from the most-popular page across all channels. No input required.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-detik-com-api-407223fe/get_latest_news \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### search_articles

Full-text search over detik.com articles across all channels. Results are paginated and can be sorted by relevance or recency. Optionally fetches full article content for the first 5 results (incurs additional round-trips). Results can be constrained to a date range. Returns article summaries with title, URL, snippet, publish time, channel, and thumbnail.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date_from` | string | No | Start date for filtering results (inclusive), format YYYY-MM-DD. |
| `date_to` | string | No | End date for filtering results (inclusive), format YYYY-MM-DD. |
| `include_content` | boolean | No | Whether to include full article content for the top 5 results. Each fetched article is an additional request. |
| `page` | integer | No | Page number for pagination. |
| `query` | string | Yes | Search keyword. |
| `sortby` | string | No | Sort order for results. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-detik-com-api-407223fe/search_articles \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_from":"<string>","date_to":"<string>","include_content":"<boolean>","page":"<integer>","query":"<string>","sortby":"<string>"}'
```

### search_news_only

Search for articles using detik.com's news-specific search endpoint. Returns paginated results sorted by latest. Covers all channels but uses a news-focused ranking. Results can be constrained to a date range.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date_from` | string | No | Start date for filtering results (inclusive), format YYYY-MM-DD. |
| `date_to` | string | No | End date for filtering results (inclusive), format YYYY-MM-DD. |
| `page` | integer | No | Page number for pagination. |
| `query` | string | Yes | Search keyword. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-detik-com-api-407223fe/search_news_only \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date_from":"<string>","date_to":"<string>","page":"<integer>","query":"<string>"}'
```
