> ## Documentation Index
> Fetch the complete documentation index at: /docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Use Importly from Lovable, Bolt or Replit

> Add video downloads, transcripts or metadata to an app you're building in Lovable, Bolt or Replit: store the API key as a secret and call the REST API from a backend function.

App builders like Lovable, Bolt and Replit write the code for you, but a video download or transcript that works in the preview often fails once the app runs on a server, and many videos have no captions. Your app can call Importly's REST API instead. You don't need the MCP server for this: the same API key works from your app's backend.

## 1. Store your key as a secret

Copy your key from the [API key page](https://www.importly.io/dashboard/api-key) and save it as a secret named `IMPORTLY_API_KEY`:

* If your app uses Supabase (Lovable and Bolt apps often do), add it as an Edge Function secret.
* On Replit, add it in the Secrets tool.

Never paste the key into frontend code or a prompt that ends up in the browser. Anyone who can read it can spend your credit.

## 2. Ask for the feature

Paste a prompt like this into the builder, and change the first line to what your app should do:

Transcripts for video links

When a user adds a video link, send it to the Importly API from a backend function (POST [https://api.importly.io/transcribe](https://api.importly.io/transcribe)) and store the transcript text with the link. Read the key from the IMPORTLY\_API\_KEY secret, never from client code. Check the job with GET [https://api.importly.io/transcribe/status?id=JOB\_ID](https://api.importly.io/transcribe/status?id=JOB_ID) until it is completed or failed. If it fails with TRANSCRIPTION\_PROVIDER\_REQUIRED, the video has no captions: retry with "provider": "importly" to transcribe the audio. Docs: [https://www.importly.io/llms.txt](https://www.importly.io/llms.txt)

For downloads, use `POST /import` and save `mediaUrl`; for title, duration and thumbnail, use `POST /metadata/basic`. See [Downloads](/docs/features/downloads.md), [Transcripts](/docs/features/transcripts.md) and [Metadata](/docs/features/metadata.md).

## 3. Check what it wrote

A working integration looks like this Supabase Edge Function. It starts a transcript job and returns the job ID:

```ts supabase/functions/start-transcript/index.ts theme={null}
Deno.serve(async (req) => {
  const { url } = await req.json()

  const res = await fetch('https://api.importly.io/transcribe', {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${Deno.env.get('IMPORTLY_API_KEY')}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ url }),
  })

  const { data } = await res.json()
  return Response.json({ jobId: data.jobId }, { status: res.status })
})
```

A second function, or the same one, reads the result. A completed job has the text under `result.text`, and a failed one has a `message`:

```ts supabase/functions/transcript-status/index.ts theme={null}
Deno.serve(async (req) => {
  const { jobId } = await req.json()

  const res = await fetch(`https://api.importly.io/transcribe/status?id=${jobId}`, {
    headers: { Authorization: `Bearer ${Deno.env.get('IMPORTLY_API_KEY')}` },
  })

  const { data } = await res.json()
  return Response.json({ status: data.status, text: data.result?.text, message: data.message })
})
```

The frontend calls the first function, then calls the second every few seconds until `status` is `completed` or `failed`. If your app has a public backend URL, you can pass a `webhookUrl` instead of polling. See [Webhooks](/docs/webhooks.md).

> [!NOTE]
>
> A caption transcript costs $0.003. A video without captions fails with `TRANSCRIPTION_PROVIDER_REQUIRED` and nothing is charged; send it again with `"provider": "importly"` for AI speech-to-text at $0.01 per minute. New accounts get **\$3.00 in free credits, no card required**. See [Pricing & credits](/docs/billing.md).

## Give the build chat Importly's tools

Lovable and Bolt can also connect Importly's [MCP server](/docs/integrations/mcp.md) to their chat. The builder can then fetch a transcript or a video's details while you work, and read Importly's integration guide before it writes the code. This only affects the chat: your published app still calls the REST API with the secret from step 1.

> [tab] Lovable
>
> Open **Connectors**, select **Add custom**, and choose **MCP server**. Name it `Importly`, enter `https://mcp.importly.io/mcp`, leave authentication on **OAuth**, and click **Add & authorize** to sign in to Importly. If sign-in doesn't complete, add it again with the **Bearer token** option and paste your API key.

> [tab] Bolt
>
> Click **Connectors**, then **Manage connectors**, then **Custom MCP server**. Name it `Importly`, enter `https://mcp.importly.io/mcp`, keep the transport on **HTTP**, choose **MCP OAuth**, and click **Connect** to sign in to Importly.

## Using Claude Code or Cursor instead?

Connect the [MCP server](/docs/integrations/mcp.md) and your agent can write the integration for you. See [Build with your agent](/docs/integrations/build-with-your-agent.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.