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

> Check the live stream schedule for Massachusetts legislative sessions on any date to find when the General Court is broadcasting. Plan your viewing of state senate and house proceedings directly from the official legislature website.

**Category:** Government & Public Data | **Website:** [malegislature.gov/](https://malegislature.gov/) | **Docs:** [parse.bot/marketplace/1a50292e-6614-4bd9-805e-22be8702f50a/malegislature-gov-api](https://parse.bot/marketplace/1a50292e-6614-4bd9-805e-22be8702f50a/malegislature-gov-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-malegislature-gov-api-1a50292e/`
**Auth:** `Authorization: Bearer <LOCUS_API_KEY>`

## Endpoints

### get_events

Returns all hearings and events from the Massachusetts Legislature for a given month and year. Each event includes its time, status, type, title, location, video availability, and detail-page fields (video file URL, video start time, description, duration). Supports filtering by event type (Hearings, Sessions, SpecialEvents) and branch (Senate, House, Joint). Makes 1 + N requests (one list page plus one detail page per event). Returns an empty events array when no events match the filters.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `branch` | string | No | Filter by legislative branch. One of: Senate, House, Joint. When omitted, returns events from all branches. |
| `month` | integer | No | Month number (1-12). When omitted, defaults to the current UTC month. |
| `type` | string | No | Filter by event type. One of: Hearings, Sessions, SpecialEvents. When omitted, returns all hearings and events. |
| `year` | integer | No | Four-digit year (e.g. 2026). When omitted, defaults to the current UTC year. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-malegislature-gov-api-1a50292e/get_events \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"branch":"<string>","month":"<integer>","type":"<string>","year":"<integer>"}'
```

### get_schedule

Returns all legislative hearings, sessions, and events for a specific date from the Massachusetts Legislature website. Hits the Calendar page filtered to the given date and visits each event's detail page for video, duration, and description info (1 + N requests where N is the number of events). Returns a sessions array of LiveMediaScheduleItem objects. When date is omitted, defaults to the current UTC date. Returns an empty sessions array when no events are scheduled for that date.

**Estimated cost:** Metered

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `date` | string | No | Date in YYYYMMDD format (e.g. 20260701). Events for this specific date are fetched. When omitted, defaults to the current UTC date. |

```bash
curl -X POST https://api.paywithlocus.com/api/wrapped/parse-malegislature-gov-api-1a50292e/get_schedule \
  -H "Authorization: Bearer YOUR_LOCUS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"date":"<string>"}'
```
