# Automated social media research API: niche research jobs and schedules

> The lulubanana research API starts a full niche research with one request: send a niche sentence (search terms are planned for you) or your own terms, and an agent searches TikTok, YouTube Shorts and Instagram Reels, scores every video, analyses hooks and formats, writes an evidence-backed report and compares the run with the previous one. Runs can repeat daily, weekly, monthly or every N days.

lulubanana is a content research platform and API for short-form video (TikTok, YouTube Shorts and Instagram Reels). Base address: https://lulubanana.com/api/v1. Authentication: `Authorization: Bearer lb_...`. Reads are free; collection is priced like the app.

## 10 things you can do with the social media research API

1. Start a research job from one sentence
2. Start up to 5 research jobs in one call, all or nothing
3. Follow queued, collecting, analyzing, completed, partially_completed, failed and canceled
4. Read coverage, freshness, credits charged and cache reuse
5. Get the AI report with evidence videos and confidence
6. See what is new since the agent's previous run: outliers, trends and opportunities
7. Read the results as a Markdown document (?format=markdown)
8. Schedule research daily, weekly, monthly or every 2-90 days
9. Cancel a queued job and get the credits back
10. Let autopilot refine search terms

## How it works

1. POST /research/jobs with a niche (one research run, 100 credits), or POST /research/jobs/batch with up to 5.
2. Poll GET /research/jobs/{id} every 15 seconds.
3. Read GET /research/jobs/{id}/results (JSON, or ?format=markdown); new_since_previous lists what changed since the previous run.

## Endpoints

### POST /api/v1/research/jobs

Start a full niche research in one call: send a niche sentence (search terms are planned for you, free) or your own terms, or an agent_id to run again. Costs one research run, like the app; a failed run is refunded and a canceled queued job is refunded. When planning takes longer than 40 s the reply is status "planning" with a plan_job_id: send {"plan_job_id"} again (the rest of the request is kept); a plan starts one job, so sending it again returns that job without a new charge. Poll /research/jobs/{id} every 15 s; statuses: queued, collecting, analyzing, completed, partially_completed, failed, canceled.

Cost: 100 credits.

| Parameter | In | Type | Description |
| - | - | - | - |
| `niche` | body | string | One sentence about the niche and audience (15-500 characters). Search terms are planned from it for free when terms is left out |
| `terms` | body | array | 3-10 search phrases (optional when niche is sent) |
| `plan_job_id` | body | number | Resume a job whose planning took longer than 40 seconds |
| `agent_id` | body | number | Run an existing agent instead |
| `name` | body | string | A name (default: from the niche) |
| `excludes` | body | array | Words that mark a video as off-topic |
| `platforms` | body | array | Any of tt, yt, ig (default all three) |
| `en_only` | body | boolean | English videos only (default true) |

```bash
curl -X POST "https://lulubanana.com/api/v1/research/jobs" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"niche":"Affordable skincare routines for college students","platforms":["tt","yt","ig"]}'
```

Example reply:

```json
{
  "data": {
    "id": 1001,
    "agent_id": 42,
    "status": "queued",
    "terms": [
      "cheap skincare routine",
      "drugstore skincare for acne",
      "skincare routine under 20 dollars"
    ],
    "credits_used": 100,
    "credits_remaining": 1900,
    "poll_url": "/api/v1/research/jobs/1001"
  }
}
```

### POST /api/v1/research/jobs/batch

Start 1-5 research jobs in one call (each item is a POST /research/jobs body: niche, terms or agent_id). Costs one research run per job (100 credits each); all or nothing: the balance (and the key's monthly limit) must cover the whole batch, and every job starts in one transaction, or none does. A run already going for an agent is returned free. Missing terms are planned for free (up to 40 s; else status planning with plan_job_ids to send back, nothing charged).

Cost: 100 credits.

| Parameter | In | Type | Description |
| - | - | - | - |
| `niches` (required) | body | array | 1-5 research job bodies, each like POST /research/jobs: {niche} or {terms} or {agent_id} |

```bash
curl -X POST "https://lulubanana.com/api/v1/research/jobs/batch" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"niches":[{"niche":"Home espresso for beginners with a first machine"},{"niche":"Latte art at home for coffee lovers on a budget"}]}'
```

Example reply:

```json
{
  "data": {
    "status": "queued",
    "jobs": [
      {
        "index": 0,
        "id": 1001,
        "agent_id": 42,
        "status": "queued",
        "terms": [
          "espresso for beginners",
          "home espresso setup",
          "dial in espresso"
        ],
        "credits_used": 100,
        "poll_url": "/api/v1/research/jobs/1001",
        "results_url": "/api/v1/research/jobs/1001/results"
      },
      {
        "index": 1,
        "id": 1002,
        "agent_id": 43,
        "status": "queued",
        "terms": [
          "latte art at home",
          "milk frothing tips",
          "latte art for beginners"
        ],
        "credits_used": 100,
        "poll_url": "/api/v1/research/jobs/1002",
        "results_url": "/api/v1/research/jobs/1002/results"
      }
    ],
    "credits_used": 200,
    "credits_remaining": 1640
  }
}
```

### GET /api/v1/research/jobs

Your research jobs, newest first, with their status.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `limit` | query | string | 1-100 (default 20) |
| `cursor` | query | string | next_cursor from the previous page |

```bash
curl "https://lulubanana.com/api/v1/research/jobs" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/research/jobs/{id}

One research job's status. Poll every 15 seconds until completed, partially_completed, failed or canceled.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/research/jobs/1001" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

Example reply:

```json
{
  "data": {
    "id": 1001,
    "agent_id": 42,
    "status": "collecting",
    "detail": "Searching TikTok",
    "created_at": "2026-11-23T09:00:00.000Z",
    "results_url": "/api/v1/research/jobs/1001/results",
    "poll_after_seconds": 15
  }
}
```

### POST /api/v1/research/jobs/{id}/cancel

Cancel a job that has not started collecting yet; its credits come back. A canceled scheduled run skips that occurrence: the schedule continues with the next one. A job already collecting finishes on its own.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl -X POST "https://lulubanana.com/api/v1/research/jobs/1001/cancel" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### GET /api/v1/research/jobs/{id}/results

Everything a finished job found: coverage (videos per platform, outliers, off-topic filtered, per-term results, coverage_status), freshness, credits charged and cache reuse, top videos with creator-relative outlier ratios, the AI report, what changed since the previous run, and new_since_previous: the outliers, trends (and trend stage changes) and opportunities (new report themes and ideas, search opportunities) that the agent's previous finished run did not have. ?format=markdown answers one Markdown document (text/markdown).

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |
| `limit` | query | string | Top videos to include, 1-100 (default 25) |
| `format` | query | json, markdown | json (default) or markdown |

```bash
curl "https://lulubanana.com/api/v1/research/jobs/1001/results" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/research/schedules

Your recurring research (agents on a schedule).

Cost: free.

```bash
curl "https://lulubanana.com/api/v1/research/schedules" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### POST /api/v1/research/schedules

Start recurring research: daily, weekly, monthly or every N days (2-90). The first run starts now; each run costs one research run, like the app.

Cost: 100 credits.

| Parameter | In | Type | Description |
| - | - | - | - |
| `niche` | body | string | One sentence about the niche and audience (15-500 characters). Search terms are planned from it for free when terms is left out |
| `terms` | body | array | 3-10 search phrases (optional when niche is sent) |
| `plan_job_id` | body | number | Resume a job whose planning took longer than 40 seconds |
| `agent_id` | body | number | Run an existing agent instead |
| `name` | body | string | A name (default: from the niche) |
| `excludes` | body | array | Words that mark a video as off-topic |
| `platforms` | body | array | Any of tt, yt, ig (default all three) |
| `en_only` | body | boolean | English videos only (default true) |
| `cadence` | body | daily, weekly, monthly | daily, weekly or monthly |
| `every_days` | body | number | Custom interval: every N days, 2-90 (instead of cadence) |

```bash
curl -X POST "https://lulubanana.com/api/v1/research/schedules" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"niche":"Affordable skincare routines for college students","every_days":3}'
```

### PATCH /api/v1/research/schedules/{id}

Pause or resume (status "paused" | "active"), change cadence or every_days (null clears it), terms, platforms or autopilot.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |
| `status` | body | active, paused | active or paused |
| `cadence` | body | daily, weekly, monthly | daily, weekly or monthly |
| `every_days` | body | number | Every N days, 2-90, or null |
| `terms` | body | array | 3-10 search phrases |
| `platforms` | body | array | Any of tt, yt, ig |
| `excludes` | body | array | Off-topic words |
| `autopilot` | body | boolean | Autopilot on or off |

```bash
curl -X PATCH "https://lulubanana.com/api/v1/research/schedules/42" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"status":"paused"}'
```

### POST /api/v1/agents/plan

Turn one sentence into a plan (name, search terms, words to filter out). Body: {brief}. Read the plan from GET /jobs/{job_id}.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `brief` (required) | body | string | One sentence about the niche, 15-500 characters |
| `en_only` | body | boolean | Keep only English videos (default true) |

```bash
curl -X POST "https://lulubanana.com/api/v1/agents/plan" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"brief":"Affordable skincare routines for college students"}'
```

### POST /api/v1/agents

Create an agent and start its first run. Body: {name, brief, terms[3-10], excludes[], platforms["tt","yt","ig"], cadence "once|daily|weekly|monthly", en_only, autopilot}.

Cost: 100 credits.

| Parameter | In | Type | Description |
| - | - | - | - |
| `name` (required) | body | string | Agent name |
| `brief` (required) | body | string | What you want to learn about the niche |
| `terms` (required) | body | array | 3-10 search terms |
| `excludes` | body | array | Words that mark a video as off-topic |
| `platforms` | body | array | Platforms to search (default all three) |
| `cadence` | body | once, daily, weekly, monthly | once, daily, weekly or monthly (default once) |
| `en_only` | body | boolean | Keep only English videos (default true) |
| `autopilot` | body | boolean | Let the agent replace weak search terms and add timely keywords (default false) |

```bash
curl -X POST "https://lulubanana.com/api/v1/agents" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Student skincare","brief":"Affordable skincare for students","terms":["cheap skincare routine","drugstore skincare","skincare for acne"],"cadence":"weekly"}'
```

### GET /api/v1/agents

Your research agents with their last run.

Cost: free.

```bash
curl "https://lulubanana.com/api/v1/agents" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}

One agent, with the done signal: finalized (true once the run and its AI report have stopped), stage, progress_pct, eta_seconds and pending_jobs (each with poll_url and retry_after_seconds). Null fields before finalized mean "not ready", not "nothing found". latest_run_status "failed" means finished but no results.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/agents/42" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### PATCH /api/v1/agents/{id}

Change name, terms, excludes, platforms, cadence, en_only, autopilot or status ("active" | "paused").

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |
| `name` | body | string | New name |
| `brief` | body | string | New brief |
| `terms` | body | array | 3-10 search terms |
| `excludes` | body | array | Off-topic words |
| `platforms` | body | array | Platforms to search |
| `cadence` | body | once, daily, weekly, monthly | once, daily, weekly or monthly |
| `en_only` | body | boolean | Keep only English videos |
| `autopilot` | body | boolean | Autopilot on or off |
| `status` | body | active, paused | "active" or "paused" |

```bash
curl -X PATCH "https://lulubanana.com/api/v1/agents/42" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"terms":["cheap skincare routine","drugstore skincare","skincare for acne","skincare under 20"]}'
```

### DELETE /api/v1/agents/{id}

Delete an agent and its results.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl -X DELETE "https://lulubanana.com/api/v1/agents/42" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### POST /api/v1/agents/{id}/run

Start a research run now. If one is already queued or running you get its job back and pay nothing.

Cost: 100 credits.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl -X POST "https://lulubanana.com/api/v1/agents/42/run" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

### GET /api/v1/agents/{id}/runs

The last 30 runs with results and credits charged.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/agents/42/runs" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}/runs/{run_id}

One run: status, stage, videos found, outliers, credits used.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |
| `run_id` (required) | path | string | run_id |

```bash
curl "https://lulubanana.com/api/v1/agents/42/runs/315" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}/summary

Everything about an agent in one call: last run, counts, per-platform benchmarks, top 10 organic outliers, winners against the rest, live trends, the AI report and breaking events. Start here.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/agents/42/summary" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}/report

The AI report for the latest run (or ?run_id=): key_highlight, themes (why_it_works, tactics, confidence 0-1, evidence_ids), content ideas from viewers' comments, and the sample behind it. Numbers are computed; quote evidence ids.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |
| `run_id` | query | string | A past run id (default: the latest report) |

```bash
curl "https://lulubanana.com/api/v1/agents/42/report" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}/analysis

Every AI report written for this agent (one per run), newest first. Read one in full with /agents/{id}/report?run_id=.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |
| `limit` | query | string | Results per page, 1-50 (default 10) |
| `cursor` | query | string | next_cursor from the previous page |

```bash
curl "https://lulubanana.com/api/v1/agents/42/analysis" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}/analysis/latest

The latest AI report: key highlight, themes with evidence videos and confidence, viewer ideas from comments, breaking events.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/agents/42/analysis/latest" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}/compare

What changed since the previous run: headline numbers, new and dropped videos, the biggest view gains.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/agents/42/compare" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/agents/{id}/activity

What autopilot changed and why: replaced search terms, timely keywords from breaking events, weak-term reviews.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/agents/42/activity" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### PUT /api/v1/agents/{id}/autonomy

Turn autopilot on or off (it replaces weak search terms and adds timely keywords; every change is listed in /agents/{id}/activity).

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |
| `enabled` (required) | body | boolean | true to turn autopilot on, false to turn it off |

```bash
curl -X PUT "https://lulubanana.com/api/v1/agents/42/autonomy" \
  -H "Authorization: Bearer $LULUBANANA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"enabled":true}'
```

### GET /api/v1/agents/{id}/ads

Meta ads found for this agent's search terms, longest-running first among active ones (an ad that keeps running is usually working).

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/agents/42/ads" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

### GET /api/v1/jobs/{id}

Progress and result of a run or a plan. Poll every 15 seconds until finalized is true (for a run: the run and its AI report are both done). status "failed" means finished without results; a failed run is refunded.

Cost: free.

| Parameter | In | Type | Description |
| - | - | - | - |
| `id` (required) | path | string | The id in the path |

```bash
curl "https://lulubanana.com/api/v1/jobs/1001" \
  -H "Authorization: Bearer $LULUBANANA_KEY"
```

## FAQ

**How long does a research job take?**
About 13 minutes (9 in 10 within 17), plus about a minute for the AI report. Poll every 15 seconds.

**Do repeated runs cost extra for the same data?**
Results collected in the last 14 days are reused instead of collected again, and starting the same agent again within 6 hours returns the last run for free.

**Can I start several niches at once?**
Yes. POST /research/jobs/batch takes 1-5 bodies of POST /research/jobs and costs one research run each (100 credits). It is all or nothing: your balance and the key's monthly limit must cover the whole batch, and every job starts in one transaction, or none does. A run already going for an agent comes back free. If planning the search terms takes over 40 seconds, the reply is status planning with plan_job_ids to send back, and nothing is charged.

**What does new_since_previous show?**
The outliers, trends (new ones and stage changes) and opportunities this run found that the agent's previous finished run did not, with the previous run id and how the two were compared. The agent's first run has nothing to compare with, so its fields are empty and a note says why.

More: https://lulubanana.com/developers/ - all endpoints https://lulubanana.com/developers/endpoints/ - research guide https://lulubanana.com/ai-guide.txt
