# Reeling API and MCP examples | Reeling Developers

> Run tested examples for account discovery, video request drafts, status polling and analytics. Start offline, then opt in to authenticated requests.

Canonical: https://reeling.app/developers/examples
Last updated: 2026-10-20

## Introduction

Clone the open-source Reeling examples to check account access, draft a video request, poll delivery and read analytics. Every account example starts with an offline fixture or a local request draft.

## Runnable Reeling Code Examples & Execution Modes

| Script Name | Default Mode (Offline) | Live Flag | Operational Scope |
| --- | --- | --- | --- |
| examples/read-account.mjs | Displays mock project & channel summary | --live-read | Queries GET /projects and GET /channels; redacts private IDs. |
| examples/schedule-video.mjs | Prints validated JSON request draft | --publish | Submits POST /publish with reviewed payload and returns post_id. |
| examples/poll-status.mjs | Simulates polling lifecycle with mock statuses | --live-read | Polls GET /posts/:id up to 12 times with 5s backoff intervals. |
| examples/read-analytics.mjs | Outputs sample cross-network analytics | --live-read | Fetches stored analytics overview for the selected project. |
| examples/observe-mcp.mjs | Offline tool schema verification | --samples=N | Measures public MCP tools/list latency without credential exposure. |

## Clone and run without credentials

Use Node.js 22 or later. The examples use Node’s built-in fetch and test runner and have no npm dependencies. The tests cover explicit channel selection, private/inbox defaults, per-platform failure handling, polling timeouts and ambiguous POST errors.

The default results are labeled offline fixtures. They demonstrate output shapes and recovery logic; they do not represent customer data or successful live posts.

```
git clone https://github.com/yomariano/reeling-examples.git
cd reeling-examples
npm test
node examples/read-account.mjs
node examples/poll-status.mjs
node examples/read-analytics.mjs
```

- [Open reeling-examples on GitHub](https://github.com/yomariano/reeling-examples)

## Configure a real account read

Create a local ignored .env using the documented variable names. Use your own project and channel IDs. Node does not load the file automatically; pass --env-file=.env. The account script requires --live-read before it sends either discovery GET.

Your API key can authorize writes. The scripts constrain their operations, but the key itself is not read-only. Keep the file and live outputs out of source control.

```
node --env-file=.env examples/read-account.mjs --live-read
```

- [Account read source](https://github.com/yomariano/reeling-examples/blob/main/examples/read-account.mjs)
- [API setup guide](https://reeling.app/developers/api)

## Draft before publishing

Set the media URL, exact channel, project, caption and intended time locally. The scheduling script prints the request first without submitting. Review the destination, visibility and audience settings before adding --publish.

The example selects one channel per invocation and defaults to private YouTube visibility and TikTok inbox delivery. For several destinations, make explicit reviewed requests instead of silently selecting every connected channel.

```
node --env-file=.env examples/schedule-video.mjs
# After reviewing the payload and platform options:
node --env-file=.env examples/schedule-video.mjs --publish
```

- [Scheduling example source](https://github.com/yomariano/reeling-examples/blob/main/examples/schedule-video.mjs)
- [Publishing requirements](https://reeling.app/developers/social-publishing-api)

## Poll status and read analytics

Save the returned post_id. The polling example makes at most 12 reads, spaced five seconds apart. It reports processing, failure, reported publication and timeout separately. A scheduled post may remain pending beyond the observation window.

The analytics example reads the selected project’s stored overview. Its output is private account data. The supplied code does not request synchronization, manufacture missing metrics or infer revenue attribution.

```
node --env-file=.env examples/poll-status.mjs --live-read
node --env-file=.env examples/read-analytics.mjs --live-read
```

- [Polling logic and tests](https://github.com/yomariano/reeling-examples/blob/main/test/examples.test.mjs)

## Plan an editorial calendar

Use the free calendar builder for dates, topic rotation and timezone labels. Download a CSV and review it in a spreadsheet with an owner and status. It is an editorial worksheet, not a bulk-upload contract.

For assistant integrations, generate a local or hosted MCP template and replace the placeholder key in your client. First verify project and channel reads; inspect the tool schema before approving publishing.

- [Build a content calendar](https://reeling.app/tools/content-calendar)
- [Build an MCP configuration](https://reeling.app/tools/mcp-config-generator)
- [Adapter source and architecture](https://github.com/yomariano/reeling-mcp)

## Frequently Asked Questions

### Do the runnable examples require npm dependencies or third-party packages?

No. All examples in the reeling-examples repository are written in native modern JavaScript for Node.js 22+ using built-in fetch and node:test. No npm install is required to run the test suite or offline fixture scripts.

### How do I switch an example from offline fixture mode to an authenticated live read?

Create a local '.env' file containing 'REELING_API_KEY=rl_live_your_key' and run the script with Node's native env flag and the live argument: 'node --env-file=.env examples/read-account.mjs --live-read'. The script confirms your identity without exposing private keys in terminal logs.

### How do the examples prevent accidental duplicate social media posts?

The scheduling script requires a two-step process: running 'node examples/schedule-video.mjs' prints the local payload for review without submitting. Only passing the explicit '--publish' flag dispatches the HTTP POST. If a timeout occurs, the script prompts you to check the existing post ID rather than resubmitting.

### Can I run the example suite in CI/CD pipelines to verify API contracts?

Yes. Run 'npm test' in the repository root. The built-in test suite verifies payload structures, explicit channel selection, date validation, and status polling logic against offline fixtures without requiring live network access or secret credentials.

## Related

- [Developer Portal Overview](https://reeling.app/developers)
- [Reeling MCP server setup](https://reeling.app/developers/mcp)
- [Reeling publishing API reference](https://reeling.app/developers/api)
- [Social publishing API requirements](https://reeling.app/developers/social-publishing-api)
- [Social publishing workflow lab](https://reeling.app/developers/workflow-lab)
- [API security, OAuth & rate limits](https://reeling.app/developers/security)
- [Social Media APIs for Posting (2026)](https://reeling.app/developers/social-media-api)
- [Instagram Posting API (2026)](https://reeling.app/developers/instagram-posting-api)
- [YouTube Video Upload API (2026)](https://reeling.app/developers/youtube-upload-api)
- [Buffer API (2026): Limits, Keys and MCP](https://reeling.app/developers/buffer-api)
- [Reeling MCP Config Generator](https://reeling.app/tools/mcp-config-generator)

---
Need the interactive version? Visit https://reeling.app/developers/examples
Full site index for AI agents: https://reeling.app/llms.txt
