Skip to main content
The Lovable API Build with URL feature lets you create applications by passing a prompt, and optionally reference images or web pages, through URL parameters. Embed it in a website, an internal tool, or an automation, and users generate a Lovable app with a single click. Each link tells Lovable what to build and optionally what to reference, such as images to work from or a live web page to draw layout and content from. Example:
https://lovable.dev/?autosubmit=true#prompt=Create%20a%20todo%20app
Clicking this link opens Lovable and begins building a to-do app.

Use cases

You can do the following with the Build with URL API:
  • Embed a Build with Lovable button on your website or application. When the user clicks it, Lovable opens and builds the app automatically.
  • Recreate or iterate on an existing web page by passing its URL as a reference.
  • Share predefined prompts via URLs with friends, colleagues, or social media.
  • Automate app generation as part of internal workflows.
You can construct the URL yourself, or use the Lovable Link Generator. See below for more information.

Base URL

https://lovable.dev/?autosubmit=true#
autosubmit (boolean): Set this to true to process the request automatically on load.

URL with parameters

Parameters go in the URL hash fragment (after #), not the query string:
https://lovable.dev/?autosubmit=true#prompt=YOUR_PROMPT&images=IMAGE_URL&html=PAGE_URL

Parameters

ParameterTypeDescriptionRequired/Optional
promptstringText describing the application to build. Maximum 50,000 characters. Use URL encoding (for example, %20 for spaces). Very long URLs might fail due to browser or parsing limits.Required
imagesstringA publicly accessible image URL used as a visual reference. Repeat the key for several (images=URL1&images=URL2). Raster formats only: JPEG, PNG, and WebP.Optional
htmlstringA publicly accessible web page URL. Lovable fetches the page and uses it as a reference for layout, content, and styling. Repeat the key for several.Optional

Attachment limits

  • images and html share a combined limit of 10 reference attachments per link.
  • Every images and html URL must be reachable over public http or https, because Lovable’s servers fetch them. Lovable skips private, authenticated, or localhost URLs.
  • Lovable ignores non-raster image URLs (such as SVG and GIF) and malformed or non-http(s) URLs. The rest of the link still builds.
Use the Lovable Link Generator to build shareable URLs that generate apps with your chosen prompt, images, and web pages. It also handles URL encoding so links stay valid.
  1. Enter your prompt, which describes the application to build (up to 50,000 characters).
  2. Add reference images. The generator uploads each image to your Lovable account and references it in the link, so the image does not need to stay publicly hosted.
  3. Add reference web pages by URL. Each page must be publicly reachable, because Lovable fetches it server-side.
  4. Copy the generated Lovable URL and share it.
Generating a link requires you to sign in to Lovable, because uploads are tied to your account. Images and web pages share a limit of 10 references per link.

Build with URL examples

Basic app generation
https://lovable.dev/?autosubmit=true#prompt=Create%20a%20todo%20app
Reference image
https://lovable.dev/?autosubmit=true#prompt=Build%20a%20landing%20page%20with%20this%20logo&images=https://img.com/logo.png
Reference an existing web page
https://lovable.dev/?autosubmit=true#prompt=Recreate%20this%20page&html=https://example.com/index.html
Web page and image together
https://lovable.dev/?autosubmit=true#prompt=Rebuild%20this%20page%20with%20our%20logo&html=https://example.com/index.html&images=https://img.com/logo.png

Best practices

  • Keep prompts concise and focused on core features.
  • For html, point at a standard web page served as a normal HTML document. Lovable may skip pages without a recognizable HTML structure.
  • Make sure every image and page URL is publicly reachable.
  • Use clear, descriptive language for the best generation results.
  • URL-encode special characters in the prompt and in URLs to avoid parsing issues.

App creation and authentication flow for shared URLs

When you click a Build with URL link:
  • If you are signed in, you select a workspace and Lovable starts building the app automatically.
  • If you are signed out, you sign up or log in first. After you authenticate, you select a workspace and Lovable builds the app automatically, preserving the original prompt and references.

Error handling

  • Lovable silently drops reference URLs that are non-public, non-raster (for images), or not valid http(s). The app still builds from the prompt and the remaining attachments.
  • Very long or malformed URLs can cause browser “URL too long” errors, incomplete parameter parsing, or failed autosubmission. Keep prompts within the 50,000-character limit, and prefer the Link Generator for long inputs.

FAQ

Which image formats can I reference? JPEG, PNG, and WebP. Lovable ignores other formats, such as SVG and GIF. Do my image and page URLs need to be public? Yes. Lovable fetches them server-side, so it skips private, authenticated, or localhost URLs. The Link Generator works around this for images by uploading them to your account. How many references can I add to one link? Up to 10 in total, combining images and web pages. Can the Link Generator reference a web page? Yes. Add the web page URL in the generator, alongside any images. Each page must be publicly reachable, because Lovable fetches it server-side. What happens when a signed-out user clicks a link? They sign up or log in first. After they authenticate, they select a workspace, and the app builds automatically with the original prompt and references preserved.