bmiapi
SearchListsPricingDocsStatus

Developer docs

The raw contract first: exact requests, response shapes, queue behavior, and runnable list loops.

OpenAPI JSON →

Checking key options…

Your key is shown only once. Leave without copying it?

Quickstart

  1. Sign in to choose a key, or replace bmi_YOUR_KEY in these examples.
  2. Send Authorization: Bearer bmi_YOUR_KEY to a search endpoint.
  3. Read 200 for the answer or 202 for the job and Retry-After.

Revoking a key takes effect within seconds. A request already reaching an edge server may still complete.

Lookups without a progress stream return a completed answer or a queued job within 30 seconds of request arrival.

curl -X POST https://bmiapi.com/api/v1/title-search \
  -H "Authorization: Bearer bmi_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"title":"STAND BY ME"}'

Sign in to choose a key, or replace bmi_YOUR_KEY in these examples.

Endpoints and request fields

All search bodies are JSON. A secondary filter is sent with its value as a pair. Defaults are searchDatabase: Songview, viewCount: 20, pageNumber: 1, and dedupe: true.

EndpointBody or path
POST /api/v1/title-searchtitle (string), secondaryFilter, secondaryValue, searchDatabase, viewCount (20|50|100), pageNumber (integer), dedupe (boolean)
POST /api/v1/writer-searchwriterComposerName (string), catalog: { partId, partIdSub, partCae } from a result's catalogQuery, plus pageNumber and viewCount up to 100
POST /api/v1/publisher-searchpublisherName (string), catalog: { partId, partIdSub, partCae } from a result's catalogQuery, plus pageNumber and viewCount up to 100
POST /api/v1/performer-searchperformerName (string), plus the shared optional fields
POST /api/v1/work-id-searchbmiWorkId (string), searchDatabase, viewCount, pageNumber, dedupe
POST /api/v1/iswc-searchiswc (string), searchDatabase, viewCount, pageNumber, dedupe
GET /api/v1/jobs/{id}id path parameter; optional claim query parameter from pollUrl

A catalog request without viewCount uses 50, the canonical BMI page size. Optional headers: Idempotency-Key and Prefer: respond-async. Add ?refresh=true to skip a saved answer and ask BMI now (one live lookup).

Full response shape

A successful search envelope always keeps these fields. A value is null when Songview does not list it; arrays can be empty when there are no matches. The example below is a schema fixture.

resultFamily
works | writers | publishers | performers · The returned row family, also present in data.metadata.
meta
object · apiVersion (v1), requestId, jobId, cached, and durationMs are required.
meta.cached
boolean · true for a saved answer; false for a live lookup.
meta.requestId
string · The required request identifier.
data.metadata
object · searchType, primaryFilter, resultFamily, primaryValue, secondaryFilter, secondaryValue, searchDatabase, viewCount, pageNumber, dedupeApplied, rawSearchContext, and encodedSearchContext.
data.results
array · Work, writer, publisher, or performer rows. Empty means no match.
pagination
object · pageNumber, viewCount, totalPages, totalResults, totalResultsIsLowerBound, hasNextPage, hasPreviousPage. Only totals may be null when Songview does not expose them.
warnings
string[] · Parse, normalization, or missing-section notes; never silently discarded.
querySuggestions
array · route, input, rules, and basis. Suggestions are never run automatically.

Work rows

Work identifiers are workTitle, bmiWorkId, songViewStatus, iswc, and ascapWorkId. proShares contains organization, percentControlled (registry percent text), workId, and note. writers.contributors and publishers.entries contain name, affiliation, ipiNumber, ipiNameNumber, isAffiliatedWithBmi, and catalog. Each section has a percentBreakdown array of organization, percent, and note. Publisher entries may supply contactInfo (emails, phoneNumbers, websites, addresses, hasContactData) and notes. publishers.hasOtherNonAscapOrBmiPublishers describes the printed label, not membership; otherPublishersNotice preserves the label text. performers.values.raw and performers.values.deduped hold the credits; performers.percentBreakdown is separate. alternateTitles and awards are arrays. derived.listedTotalPercent sums the printed shares; derived.unlistedPercent is 100 minus that total, clamped at 0, or null when the total is unavailable. No per-person shares are inferred.

Entity families

resultFamily is works, writers, publishers, or performers, also repeated in data.metadata. Identity rows use writerDisplayName, publisherDisplayName, or performerDisplayName, worksPreview, hasAdditionalTitles, and catalog. Writer and publisher identities add IPI numbers and affiliations (an array); publishers also supply akaNames and contactInfo. Entity searches can return works when narrowed by a secondary filter: read resultFamily.

{
  "resultFamily": "works",
  "data": {
    "metadata": {
      "resultFamily": "works",
      "searchType": "Title",
      "primaryFilter": "Title",
      "primaryValue": "Stop",
      "secondaryFilter": null,
      "secondaryValue": null,
      "searchDatabase": "Songview",
      "pageNumber": 1,
      "viewCount": 20,
      "dedupeApplied": true,
      "rawSearchContext": null,
      "encodedSearchContext": null
    },
    "results": [
      {
        "workTitle": "STOP",
        "bmiWorkId": "123",
        "songViewStatus": "Reconciled",
        "iswc": "T0701420714",
        "ascapWorkId": "490322031",
        "alternateTitles": [
          "STOP AND SMELL THE ROSES"
        ],
        "derived": {
          "listedTotalPercent": 100,
          "unlistedPercent": 0,
          "societies": [],
          "shareTotals": null
        },
        "awards": [],
        "proShares": [
          {
            "organization": "BMI",
            "percentControlled": "50%",
            "workId": "123",
            "note": null
          },
          {
            "organization": "ASCAP",
            "percentControlled": "50%",
            "workId": "490322031",
            "note": null
          }
        ],
        "writers": {
          "percentBreakdown": [
            {
              "organization": "BMI",
              "percent": "50%",
              "note": null
            }
          ],
          "contributors": [
            {
              "name": "DAVIS MAC",
              "affiliation": "BMI",
              "ipiNumber": "782249809",
              "ipiNameNumber": "00782249809",
              "catalog": null,
              "isAffiliatedWithBmi": true
            }
          ]
        },
        "performers": {
          "percentBreakdown": [],
          "values": {
            "raw": [],
            "deduped": []
          }
        },
        "publishers": {
          "percentBreakdown": [],
          "entries": [
            {
              "name": "SONG PUBLISHING",
              "affiliation": "BMI",
              "ipiNumber": "1",
              "ipiNameNumber": "00000000001",
              "isAffiliatedWithBmi": true,
              "catalog": null,
              "contactInfo": null,
              "notes": []
            }
          ],
          "hasOtherNonAscapOrBmiPublishers": null,
          "otherPublishersNotice": "Other Participating Publishers"
        }
      }
    ]
  },
  "pagination": {
    "pageNumber": 1,
    "viewCount": 20,
    "totalPages": 1,
    "totalResults": 1,
    "totalResultsIsLowerBound": false,
    "hasNextPage": false,
    "hasPreviousPage": false,
    "resultsOnPage": 0,
    "summary": ""
  },
  "warnings": [
    "value-unknown: publishers.hasOtherNonAscapOrBmiPublishers is null for 1 work(s) because BMI printed a newer other-publishers label (see publishers.otherPublishersNotice) instead of \"Other Non-ASCAP and Non-BMI Publishers\", and the newer label does not say whether those publishers belong to ASCAP or BMI. BMI Work IDs: 123"
  ],
  "querySuggestions": [],
  "meta": {
    "apiVersion": "v1",
    "requestId": "fixture-request-success",
    "jobId": "fixture-job-success",
    "cached": false,
    "durationMs": 1240
  }
}

202 Accepted and polling

A queued live lookup is durable. Honor Retry-After, then call the returned poll URL. Polls are free and have a separate limit of 120 per minute per job.

HTTP/1.1 202 Accepted
Retry-After: 3
Content-Type: application/json

{
  "jobId": "job_example",
  "status": "queued",
  "pollUrl": "https://bmiapi.com/api/v1/jobs/job_example?claim=EXAMPLE",
  "retryAfterSeconds": 3,
  "queuePosition": 2
}

Poll the job

curl -H "Authorization: Bearer bmi_YOUR_KEY" "https://bmiapi.com/api/v1/jobs/job_example?claim=EXAMPLE"

Final poll

{
  "jobId": "fixture-job-success",
  "requestId": "fixture-request-success",
  "createdAt": "2026-10-26T15:00:00.000Z",
  "status": "completed",
  "startedAt": "2026-10-26T15:00:03.000Z",
  "completedAt": "2026-10-26T15:00:06.291Z",
  "errorCode": null,
  "queueDepth": null,
  "response": {
    "resultFamily": "works",
    "data": {
      "metadata": {
        "resultFamily": "works",
        "searchType": "Title",
        "primaryFilter": "Title",
        "primaryValue": "Stop",
        "secondaryFilter": null,
        "secondaryValue": null,
        "searchDatabase": "Songview",
        "pageNumber": 1,
        "viewCount": 20,
        "dedupeApplied": true,
        "rawSearchContext": null,
        "encodedSearchContext": null
      },
      "results": [
        {
          "workTitle": "STOP",
          "bmiWorkId": "123",
          "songViewStatus": "Reconciled",
          "iswc": "T0701420714",
          "ascapWorkId": "490322031",
          "alternateTitles": [
            "STOP AND SMELL THE ROSES"
          ],
          "derived": {
            "listedTotalPercent": 100,
            "unlistedPercent": 0,
            "societies": [],
            "shareTotals": null
          },
          "awards": [],
          "proShares": [
            {
              "organization": "BMI",
              "percentControlled": "50%",
              "workId": "123",
              "note": null
            },
            {
              "organization": "ASCAP",
              "percentControlled": "50%",
              "workId": "490322031",
              "note": null
            }
          ],
          "writers": {
            "percentBreakdown": [
              {
                "organization": "BMI",
                "percent": "50%",
                "note": null
              }
            ],
            "contributors": [
              {
                "name": "DAVIS MAC",
                "affiliation": "BMI",
                "ipiNumber": "782249809",
                "ipiNameNumber": "00782249809",
                "catalog": null,
                "isAffiliatedWithBmi": true
              }
            ]
          },
          "performers": {
            "percentBreakdown": [],
            "values": {
              "raw": [],
              "deduped": []
            }
          },
          "publishers": {
            "percentBreakdown": [],
            "entries": [
              {
                "name": "SONG PUBLISHING",
                "affiliation": "BMI",
                "ipiNumber": "1",
                "ipiNameNumber": "00000000001",
                "isAffiliatedWithBmi": true,
                "catalog": null,
                "contactInfo": null,
                "notes": []
              }
            ],
            "hasOtherNonAscapOrBmiPublishers": null,
            "otherPublishersNotice": "Other Participating Publishers"
          }
        }
      ]
    },
    "pagination": {
      "pageNumber": 1,
      "viewCount": 20,
      "totalPages": 1,
      "totalResults": 1,
      "totalResultsIsLowerBound": false,
      "hasNextPage": false,
      "hasPreviousPage": false,
      "resultsOnPage": 0,
      "summary": ""
    },
    "warnings": [
      "value-unknown: publishers.hasOtherNonAscapOrBmiPublishers is null for 1 work(s) because BMI printed a newer other-publishers label (see publishers.otherPublishersNotice) instead of \"Other Non-ASCAP and Non-BMI Publishers\", and the newer label does not say whether those publishers belong to ASCAP or BMI. BMI Work IDs: 123"
    ],
    "querySuggestions": [],
    "meta": {
      "apiVersion": "v1",
      "requestId": "fixture-request-success",
      "jobId": "fixture-job-success",
      "cached": false,
      "durationMs": 1240
    }
  }
}

Rate limits, quota, and errors

Read Retry-After, X-Request-Id, and the quota headers X-Bmiapi-Quota-Used, X-Bmiapi-Quota-Limit, X-Bmiapi-Quota-Reset, and X-Bmiapi-Quota-Warning. Saved answers are free, up to 300 a minute per key. Saved answers always carry X-Bmiapi-Quota-Approximate: true and leave out X-Bmiapi-Quota-Used and X-Bmiapi-Quota-Warning; a live lookup carries the exact figure. Live lookups are 10/min on Free, 30/min on Builder, and 120/min on Label. Free has 10 live lookups per calendar month, resetting on the 1st (UTC); Builder has 50 a day and Label 1,000 a day, each resetting at 00:00 UTC. Every response carries X-Request-Id, a server id to quote to support; send your own tag in X-Client-Request-Id (letters, digits and ._:-, up to 64) and it comes back in the same header.

HTTPcodeWhat to do
400VALIDATIONFix the field named in issues, then resend.
401INVALID_KEYCheck the Bearer key or rotate it.
403FORBIDDENThis key cannot use the operation.
404NOT_FOUNDCheck the path or job id.
409IDEMPOTENCY_CONFLICTReuse an idempotency key only with the same body.
429QUOTA_EXCEEDED / RATE_LIMITEDWait Retry-After; saved answers remain free.
502SCRAPE_ERRORRetry with backoff; the live lookup did not complete.
503UPSTREAM_REJECTEDBMI rejected the session; check /status.
504TIMEOUTStop polling this job and start a new request later.

Optional progress stream

Send Accept: text/event-stream to watch the same request. The stream is optional; without it, status codes and JSON bodies are unchanged. Events are saved, turn, asking, answered, then result. A saved hit sends saved and result immediately.

event: saved
data: {"hit":false,"at":40}

event: turn
data: {"granted":true,"at":60}

event: asking
data: {"at":90}

event: answered
data: {"at":3090,"ms":3000,"spans":{}}

event: result
data: {"status":200,"serverTiming":"…","body":{}}

MCP endpoint

Connect by URL: give the client https://bmiapi.com/mcp, click Connect, sign in. Or send Authorization: Bearer bmi_… as a request header. It is stateless Streamable HTTP with JSON responses.

ToolWhat it answersInputsCost
search_songsWorks by title, with society shares and registered publisher contactstitle (required); secondaryFilter with secondaryValue (Performer, Writer/Composer or Publisher); pageNumber; viewCount (20, 50 or 100)free when saved, otherwise 1 live lookup
search_writersWriters by name, with two preview titles; with catalog, every work in that writer's catalogwriterComposerName (required); catalog from a result's catalogQuery; pageNumber; viewCount (a catalog page uses 50)free when saved, otherwise 1 live lookup per page
search_publishersPublishers by name, with contacts and two preview titles; with catalog, every work in that publisher's catalogpublisherName (required); catalog; pageNumber; viewCount (a catalog page uses 50)free when saved, otherwise 1 live lookup per page
search_performersPerformer credits and work previews by nameperformerName (required); secondaryFilter with secondaryValue; pageNumber; viewCountfree when saved, otherwise 1 live lookup
find_song_by_iswcOne work by ISWCiswc (required)free when saved, otherwise 1 live lookup
find_song_by_bmi_work_idOne work by BMI Work IDbmiWorkId (required)free when saved, otherwise 1 live lookup
check_lookupA queued lookup's place in line, or its answerjobId (required)free
list_my_workspacesYour active memberships and workspace IDs; creates nothingNo argumentsNo BMI lookup; key request caps apply
list_forensics_result_setsWorkspaces grouped with their result setsOptional workspaceIdNo BMI lookup; key request caps apply
create_forensics_result_setA durable publishing question and planworkspaceId, name, question; optional planNo BMI lookup; key request caps apply
update_forensics_result_setEdit name, question, recall or plansetId, patchNo BMI lookup; key request caps apply
delete_forensics_result_setDelete a set and its live evidence; blocked during active worksetIdNo BMI lookup; key request caps apply
load_forensics_recordingsLoad up to 100 songs and 300 recordings; single call at most 8 MiB with bounded free textsetId, load containing songs and recordings. Song and recording IDs use at most 200 Unicode code points. After trimming, titles, artists and ISWCs use at most 200 UTF-16 units with no interior control characters. Other free text uses 1,000 code points, and ISRCs and external IDs 256. A writer's normalized search surname also fits 200 UTF-16 units. Serialized song evidence is limited to 900,000 bytes. Each song accepts 50 ISWCs, 50 writers and 600 sources; each recording accepts 50 sources. Version-only titles remain loadable; if no identifier answer is available, a run finishes as search_refused without issuing an empty title query.No BMI lookup; key request caps apply
rescope_forensics_recordingsSet or clear up to 300 recording exclusions, or change tiers with an auditable basis, then recompute affected songs and run totalssetId, recordings containing recordingId and exclusionReason, with optional tier plus basis; unique IDs; strict 64 KiB JSON capNo BMI lookup; key request caps apply
get_forensics_result_setViewer role, counts, plan, map version and runssetIdNo BMI lookup; key request caps apply
get_forensics_rowsA bounded page of compact current recording rowssetId; optional limit (1–2,000, default 1,000), opaque cursor and since ISO timestamp; use returned asOf for the next since poll (rows may repeat)No BMI lookup; key request caps apply
get_forensics_evidenceRetained registrations, proof and matched map lines. Evidence uses a 5 MiB budget. The current decision's song, registrations and map lines are always retained together, even if that basis alone exceeds the budget. Required decision evidence is included first, then the song's recordings, then optional history selected newest-run-first within the remaining budget. Returned registrations and candidates keep their created-at/ID order. MCP includes at most 201 recordings; HTTP has no recording-count cap. recordingsOmitted, registrationsOmitted and candidatesOmitted count evidence left out of the reply.setId, songIdNo BMI lookup; key request caps apply
export_forensics_result_setSmall individual exports inline; large exports and batched exports return signed links. These links expire in 15 minutes. Open one in any browser or fetch it with plain curl; no key or sign-in is needed. After that, call export_forensics_result_set again for fresh links.setId, format (csv/json/md); optional view facetsNo BMI lookup; key request caps apply
start_forensics_runStart sample, rest, recheck, settle or fixupsetId, run containing kind; optional maxLiveLookups and selected songIdsSample/rest/fixup use saved answers first; recheck/settle spend live lookups; run cap and the plan's allowance apply
recheck_forensics_songStart a reread of one retained songsetId, songId; optional maxLiveLookupsSample/rest/fixup use saved answers first; recheck/settle spend live lookups; run cap and the plan's allowance apply
settle_forensics_checksStart a bulk reread of queued open checkssetId; optional maxLiveLookupsSample/rest/fixup use saved answers first; recheck/settle spend live lookups; run cap and the plan's allowance apply
pause_forensics_runPause dispatch and drain accepted jobssetId, runId, expectedStatusNo BMI lookup; key request caps apply
resume_forensics_runResume with current actor billing; checkpoint starts a separate rest runsetId, runId, expectedStatusSample/rest/fixup use saved answers first; recheck/settle spend live lookups; run cap and the plan's allowance apply
stop_forensics_runStop dispatch and drain accepted jobssetId, runId, expectedStatusNo BMI lookup; key request caps apply
raise_forensics_limitAudited cap increase, at most 2250; does not resumesetId, runId, expectedStatus, maxLiveLookupsNo BMI lookup; key request caps apply
override_forensics_songManual decision with reason/source; rule evidence survives. Evidence uses a 5 MiB budget. The current decision's song, registrations and map lines are always retained together, even if that basis alone exceeds the budget. Required decision evidence is included first, then the song's recordings, then optional history selected newest-run-first within the remaining budget. Returned registrations and candidates keep their created-at/ID order. MCP includes at most 201 recordings; HTTP has no recording-count cap. recordingsOmitted, registrationsOmitted and candidatesOmitted count evidence left out of the reply. Evidence-returning writes refuse with TOOBIG before committing when their required core exceeds the reply budget. The reply applies this write's song changes to an evidence snapshot read before the write; updatedAt is the committed song timestamp. GET the song again for the latest evidence after concurrent changes.setId, songId, override containing decision, reason, source; bounded textNo BMI lookup; key request caps apply
clear_forensics_overrideReveal the latest retained rule verdict. Evidence uses a 5 MiB budget. The current decision's song, registrations and map lines are always retained together, even if that basis alone exceeds the budget. Required decision evidence is included first, then the song's recordings, then optional history selected newest-run-first within the remaining budget. Returned registrations and candidates keep their created-at/ID order. MCP includes at most 201 recordings; HTTP has no recording-count cap. recordingsOmitted, registrationsOmitted and candidatesOmitted count evidence left out of the reply. Evidence-returning writes refuse with TOOBIG before committing when their required core exceeds the reply budget. The reply applies this write's song changes to an evidence snapshot read before the write; updatedAt is the committed song timestamp. GET the song again for the latest evidence after concurrent changes.setId, songIdNo BMI lookup; key request caps apply
update_forensics_song_writersAttach outside writers with a free-source URL and read time. Evidence uses a 5 MiB budget. The current decision's song, registrations and map lines are always retained together, even if that basis alone exceeds the budget. Required decision evidence is included first, then the song's recordings, then optional history selected newest-run-first within the remaining budget. Returned registrations and candidates keep their created-at/ID order. MCP includes at most 201 recordings; HTTP has no recording-count cap. recordingsOmitted, registrationsOmitted and candidatesOmitted count evidence left out of the reply. Evidence-returning writes refuse with TOOBIG before committing when their required core exceeds the reply budget. The reply applies this write's song changes to an evidence snapshot read before the write; updatedAt is the committed song timestamp. GET the song again for the latest evidence after concurrent changes.setId, songId, update containing writers and source; 600-source cap returns SOURCES_CAP and asks support to review retained provenanceNo BMI lookup; key request caps apply
redecide_forensics_result_setRe-run the current rule over stored evidencesetIdNo BMI lookup; key request caps apply

Sign-in with OAuth is open to Claude, Grok and apps on your own computer such as Claude Code. A hosted agent or a web app sends an API key as the Authorization header instead.

Forensics reads require active workspace membership; every write requires the owner or staff who is also a member. Discover IDs with list_my_workspaces. Tool schemas and structured outputs come from tools/list. These tools retain result sets and evidence until set/workspace deletion. get_forensics_rows uses pages of 1,000 rows by default (2,000 maximum), an opaque cursor, a 4 MiB row-JSON bound and an asOf watermark; use that watermark as the next since value, expect a poll to repeat rows, and continue until nextCursor is null. HTTP /rows remains a complete response. A batch pairing tools/list with a full rows page can approach the 8 MiB reply limit. Song and recording IDs use at most 200 Unicode code points. After trimming, titles, artists and ISWCs use at most 200 UTF-16 units with no interior control characters. Other free text uses 1,000 code points, and ISRCs and external IDs 256. A writer's normalized search surname also fits 200 UTF-16 units. Serialized song evidence is limited to 900,000 bytes. Each song accepts 50 ISWCs, 50 writers and 600 sources; each recording accepts 50 sources. Version-only titles remain loadable; if no identifier answer is available, a run finishes as search_refused without issuing an empty title query. Evidence uses a 5 MiB budget. The current decision's song, registrations and map lines are always retained together, even if that basis alone exceeds the budget. Required decision evidence is included first, then the song's recordings, then optional history selected newest-run-first within the remaining budget. Returned registrations and candidates keep their created-at/ID order. MCP includes at most 201 recordings; HTTP has no recording-count cap. recordingsOmitted, registrationsOmitted and candidatesOmitted count evidence left out of the reply. A writer update at the 600-source cap returns SOURCES_CAP and asks support to review retained provenance. Each MCP tools/call reply is capped at 8 MiB; oversized replies return MCP_REPLY_TOO_LARGE.

A JSON-RPC batch runs only its first tools/call. Later calls keep their IDs and receive -32000 with data.code: MCP_BATCH_ONE_CALL; send each call in its own request. Initialize, ping, tools/list, notifications and other entries keep their normal behavior.

Sample, rest and fixup runs check saved answers first. Recheck and settle runs read BMI live. Runs may spend live lookups: at most 4 submissions per rolling minute, 20 waiting (also limited by plan), and 2250 per run. Owners use their plan allowance; staff use 20,000 per UTC day. Saved answers cost zero BMI but respect key caps. A sample pauses at a checkpoint; resume starts a separate rest run. Pause and stop drain accepted jobs. Explicit resume uses the current actor’s allowance.

HTTP uses /api/v1/forensics/result-sets with a BMI key or session; session writes require the same origin. The OpenAPI contract includes load, rows, evidence, exports, scope edits and run controls. Stale controls return 409 run_changed; another active run returns 409 another_run_active. Exports apply current server facets (OR within each facet, AND across facets), include row-count headers, and name unfinished sets partial. Recording scope accepts a nullable exclusion reason; a row may also supply a new tier and required basis, and the previous tier, actor and time remain auditable. Excluded rows retain their tier and all evidence, while a song remains in scope if another recording is eligible. The scope edit is owner/staff-only, bounded to 300 unique rows and a 64 KiB body, idempotent, and is refused with 409 run_changed while a run has active work or a lease. Registry shares are by society, never by publisher; decision proof and its dated map explain the basis.

Claude Code

claude mcp add --transport http bmiapi https://bmiapi.com/mcp

Then run claude, type /mcp, and sign in to bmiapi. With a key instead of signing in, add --header "Authorization: Bearer bmi_…".

Claude.ai and Claude Desktop

  1. In Claude, open Customize, then Connectors. Click + Add, then Add custom connector.
  2. Name it bmiapi and paste the address. If Claude asks how to register, pick Register automatically. Click Connect.
  3. Sign in to bmiapi (a free account works). Ask Claude who wrote a song.

Grok

  1. On grok.com, open Plugins, then the Connectors tab, then New Connector, then Custom.
  2. Name it bmiapi, paste the address, and add the connector.
  3. Sign in to bmiapi when Grok asks. Ask Grok who controls a song.

Connect Claude or Grok →

Run a list

Set BMIAPI_KEY in your environment. Save and run the Python example with python3 (songs.csv needs a title column), or install zod and run the TypeScript example with Node 22.21.0. Both handle 202 and 429, honor Retry-After, back off, and resume the same request or running job. They neutralize spreadsheet formulas and preserve quotes and newlines in CSV.

export BMIAPI_KEY="bmi_YOUR_KEY"

Python

import csv
import os
import time
import urllib.request
import urllib.error
from datetime import datetime, timezone
from email.utils import parsedate_to_datetime
import json


def safe_cell(value):
    text = "" if value is None else str(value)
    # Tab and CR are dangerous even when followed by ordinary text.
    index = 0
    while index < len(text) and text[index].isspace() and text[index] not in "\t\r":
        index += 1
    if index < len(text) and text[index] in "=+-@\t\r":
        return "'" + text
    return text


def request(url, key, body=None):
    headers = {"Authorization": f"Bearer {key}"}
    data = None
    if body is not None:
        headers["Content-Type"] = "application/json"
        data = json.dumps(body).encode()
    try:
        response = urllib.request.urlopen(urllib.request.Request(url, data=data, headers=headers))
    except urllib.error.HTTPError as error:
        if error.code != 429:
            raise
        response = error
    with response:
        return response.status, response.headers, json.load(response)


def retry_delay(headers, fallback):
    value = headers.get("Retry-After", "")
    try:
        advice = float(value)
    except ValueError:
        try:
            advice = (parsedate_to_datetime(value) - datetime.now(timezone.utc)).total_seconds()
        except (ValueError, TypeError, OverflowError):
            advice = 0
    return max(advice, fallback)


def request_with_backoff(url, key, body=None):
    backoff = 1
    while True:
        status, headers, answer = request(url, key, body)
        if status != 429:
            return status, headers, answer
        time.sleep(retry_delay(headers, backoff))
        backoff = min(backoff * 2, 60)


def lookup(title, key):
    status, headers, answer = request_with_backoff("https://bmiapi.com/api/v1/title-search", key, {"title": title})
    if status != 202:
        return answer
    poll_url = answer["pollUrl"]
    while True:
        time.sleep(retry_delay(headers, answer.get("retryAfterSeconds", 3)))
        _, headers, answer = request_with_backoff(poll_url, key)
        if answer["status"] == "completed":
            return answer["response"]
        if answer["status"] == "failed":
            raise RuntimeError(answer["errorCode"])


def main():
    key = os.environ["BMIAPI_KEY"]
    with open("songs.csv", newline="", encoding="utf-8") as src, open("bmiapi-results.csv", "w", newline="", encoding="utf-8") as out:
        writer = csv.writer(out)
        writer.writerow(["Input", "Work title", "BMI Work ID", "ISWC", "Warning"])
        for row in csv.DictReader(src):
            envelope = lookup(row["title"], key)
            for work in envelope["data"]["results"]:
                writer.writerow([safe_cell(value) for value in [row["title"], work.get("workTitle"), work.get("bmiWorkId"), work.get("iswc"), " | ".join(envelope["warnings"])]])


if __name__ == "__main__":
    main()

TypeScript

import { writeFile } from "node:fs/promises";
import { pathToFileURL } from "node:url";
import { z } from "zod";

// Validate the fields this recipe reads; the complete schema is in /api/openapi.
const answerSchema = z.object({
  data: z.object({
    results: z.array(
      z.object({
        workTitle: z.string(),
        bmiWorkId: z.string().nullable(),
        iswc: z.string().nullable(),
      }),
    ),
  }),
  warnings: z.array(z.string()),
});
const acceptedSchema = z.object({
  pollUrl: z.string().url(),
  retryAfterSeconds: z.number().positive(),
});
const jobSchema = z.object({
  status: z.enum(["queued", "scraping", "completed", "failed"]),
  response: z.unknown(),
  errorCode: z.string().nullish(),
  retryAfterSeconds: z.number().nonnegative().optional(),
});

// Numbers calculated by this script stay numeric. Registry/input text is untrusted.
export function csvCell(value: string | number | null | undefined): string {
  let text = String(value ?? "");
  if (typeof value !== "number" && /^\s*[=+\-@\t\r]/u.test(text))
    text = "'" + text;
  return /[",\r\n]/u.test(text) ? '"' + text.replace(/"/gu, '""') + '"' : text;
}

function retryDelay(headers: Headers, fallback: number): number {
  const value = headers.get("Retry-After");
  if (!value) return fallback;
  const seconds = Number(value);
  const advice = Number.isFinite(seconds) ? seconds : (Date.parse(value) - Date.now()) / 1000;
  return Number.isFinite(advice) ? Math.max(advice, fallback) : fallback;
}
const wait = (seconds: number) => new Promise<void>((resolve) => setTimeout(resolve, seconds * 1000));

async function requestWithBackoff(url: string, init: RequestInit) {
  let backoff = 1;
  while (true) {
    const response = await fetch(url, init);
    if (response.status !== 429) return response;
    await response.body?.cancel();
    await wait(retryDelay(response.headers, backoff));
    backoff = Math.min(backoff * 2, 60);
  }
}

export async function lookup(title: string, key: string) {
  let response = await requestWithBackoff("https://bmiapi.com/api/v1/title-search", {
    method: "POST",
    headers: {
      Authorization: `Bearer ${key}`,
      "content-type": "application/json",
    },
    body: JSON.stringify({ title }),
  });
  if (response.status === 202) {
    const accepted = acceptedSchema.parse(await response.json());
    let delay = accepted.retryAfterSeconds;
    while (true) {
      await wait(retryDelay(response.headers, delay));
      response = await requestWithBackoff(accepted.pollUrl, {
        headers: { Authorization: `Bearer ${key}` },
      });
      if (!response.ok) throw new Error(await response.text());
      const job = jobSchema.parse(await response.json());
      if (job.status === "completed") return answerSchema.parse(job.response);
      if (job.status === "failed")
        throw new Error(job.errorCode ?? "Lookup failed");
      delay = job.retryAfterSeconds ?? 3;
    }
  }
  if (!response.ok) throw new Error(await response.text());
  return answerSchema.parse(await response.json());
}

async function main() {
  const key = process.env.BMIAPI_KEY;
  if (!key) throw new Error("Set BMIAPI_KEY to your API key.");
  const titles = ["Stand by Me", "What's Going On"];
  const rows: (string | number | null | undefined)[][] = [
    ["Input", "Work title", "BMI Work ID", "ISWC", "Warning"],
  ];
  for (const title of titles) {
    const envelope = await lookup(title, key);
    for (const work of envelope.data.results) {
      rows.push([
        title,
        work.workTitle,
        work.bmiWorkId,
        work.iswc,
        envelope.warnings.join(" | "),
      ]);
    }
  }
  await writeFile(
    "bmiapi-results.csv",
    rows.map((row) => row.map(csvCell).join(",")).join("\r\n") + "\r\n",
  );
}

if (process.argv[1] && pathToFileURL(process.argv[1]).href === import.meta.url)
  await main();

Vocabulary

Saved answerA stored response, free, with its age.
Live lookupA request sent to BMI now. Uses one live lookup from the available balance.
Work / songThe composition registration, not a recording or master.
Share / % controlledA society-level percentage. bmiapi never infers a per-person split.
Not listed in SongviewThe remainder the registry does not list on that page.
ReconciledBMI's word for a work whose writers, publishers and shares the Songview societies (BMI, ASCAP, SESAC and GMR) agree on. Societies outside Songview have not confirmed it.
RoundingBMI rounds each writer's and publisher's share to the hundredth, so a work's listed shares can add up to a little more or less than 100%, such as 100.03% or 99.99%. bmiapi calls that rounding and shows BMI's numbers as listed, never adjusted.
NSNo society. BMI lists no performing rights society for this writer or publisher. A share can still name BMI or ASCAP: the share says which society licenses it, which is a separate fact from the person's own membership.
AMRAThe American Mechanical Rights Agency, a US royalty collection agency owned by Kobalt. It shows up as the affiliation for some writers and publishers whose royalties it collects.
Other society namesBMI prints each writer's and publisher's society by its short name: ASCAP, SESAC and GMR in the US, PRS in the UK, SOCAN in Canada, APRA in Australia and New Zealand, GEMA in Germany, SACEM in France, STIM in Sweden, BUMA in the Netherlands, JASRAC in Japan, and others. “Other” in the shares is a share BMI lists without naming the society.
IPI name #An 11-digit number for one registered name, not for one person. A songwriter can have several: one for a legal name and one for each professional name. Songview shows only these name numbers, not the IPI base number that ties one person's names together, so the same songwriter can appear on different works under different names and numbers.
CatalogEvery work BMI lists for one writer or publisher, a page at a time. A writer search finds the person; their catalog lists the works, each with its BMI Work ID.