# Sportstoto — 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.

> Access Sports Toto Malaysia lottery jackpots, draw results, and past results calendars. Retrieve winning numbers, prize amounts, and comprehensive 4D frequency statistics for historical analysis.

**Category:** Entertainment | **Website:** [sportstoto.com.my/](https://sportstoto.com.my/) | **Docs:** [parse.bot/marketplace/65e88d64-5dd4-4fd6-9e57-26cb0019a275/sportstoto-com-my-api](https://parse.bot/marketplace/65e88d64-5dd4-4fd6-9e57-26cb0019a275/sportstoto-com-my-api)

Pay-per-use API proxy for Locus Pro. Each call burns credits from your workspace balance.

## Access

**Base URL:** `https://api.paywithlocus.com/api/wrapped/credits/sportstoto/`
**Auth:** `Authorization: Bearer <LOCUS_CREDITS_SECRET_KEY>` (an `lcr_` secret key or a scoped `lcac_` agent credential)
**Required header:** `Idempotency-Key: <fresh UUID per call>`. A retry with the same key replays the stored result without a new charge.
**Response:** the provider response after any endpoint-specific normalization. `X-Locus-Credits-Charged` carries the charge and `X-Locus-Credits-Balance` the remaining balance. Insufficient credits return `402` before the provider is called.
**Pricing:** estimated costs below are USD. Locus debits the credit equivalent at your workspace rate.

Full call contract: https://docs.paywithlocus.com/api-reference/introduction

> Using a Pay With Locus wallet key (`claw_` prefix)? Wallet routes are documented separately: https://docs.paywithlocus.com/wrapped-apis/for-agents

## Endpoints

### Get draw results

Retrieve full detailed lottery results for a specific draw by draw number. Returns results for Toto 4D (top three prizes, special and consolation), Toto 4D Jackpot amounts, Supreme Toto 6/58, Power Toto 6/55, Toto 5D, and Toto 6D. Each game section is present but may be empty if not drawn that day.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `draw_no` | string | Yes | Draw number in format NNNN/NN (e.g. '6130/26'). Obtain draw numbers from get_latest_jackpots or get_past_results_calendar. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sportstoto/get-draw-results \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"draw_no":"<string>"}'
```

### Get latest jackpots

Retrieve the current estimated jackpot amounts for all game types (Supreme Toto 6/58, Power Toto 6/55, Star Toto 6/50, 4D Jackpot) and the current draw number from the homepage. Jackpots update after each draw; amounts are formatted Malaysian Ringgit strings.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sportstoto/get-latest-jackpots \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### Get past results calendar

Retrieve a calendar of past draw dates and draw numbers for a given month and year. Useful for discovering valid draw numbers to pass to get_draw_results. Returns all draws that occurred in the specified month.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `month` | integer | Yes | Month number, 1 through 12 |
| `year` | integer | Yes | Year (e.g. 2026) |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sportstoto/get-past-results-calendar \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"month":"<integer>","year":"<integer>"}'
```

### Get statistics 4d

Retrieve 4D number frequency statistics showing the top most frequently hit numbers and their hit counts across all draws. Returns the top 20 numbers ranked by frequency.

**Estimated cost:** Metered

_No parameters required._

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/credits/sportstoto/get-statistics-4d \
  -H "Authorization: Bearer $LOCUS_CREDITS_SECRET_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
```

## Next steps

- [All wrapped API providers](https://paywithlocus.com/wapi/index.md): pick another provider.
- [Find and call tools](https://paywithlocus.com/agent/tools.md): price ceilings, async results, and errors.
- [Credits and billing](https://paywithlocus.com/agent/billing.md): what a call costs and how to add credits.
- [Agent docs index](https://paywithlocus.com/agent/index.md): every Locus agent page.