Website to Tailwind API ·GET /v1/code

Turn any website section into Tailwind CSS

The website to Tailwind converter, as an API: point it at a section of any website and get back markup with utility classes, mapped from the CSS that page really uses.

10 credits per call · 300 free credits a month · no credit card

What you get

What the Website to Tailwind API returns

stripe.com · pricing section Copy

pricing.html

<div class="rounded-2xl border p-6 md:p-8">
<p class="text-sm text-zinc-500">Pro</p>
<p class="mt-1 text-4xl font-semibold">$29</p>
<ul class="mt-4 space-y-2 text-sm">…</ul>
<button class="mt-6 w-full rounded-full bg-indigo-600
py-2 text-white hover:bg-indigo-700 md:w-auto">
Start free
</button>
</div>
Tailwind code ready to paste
  • utility classes
  • arbitrary values
  • md: variants
  • hover: variants
  • dark: variants
  • @keyframes
  • section tokens
Perfect for

Who uses it

  • Port a section to your stack

    Take a pricing table or hero from a site that is not built with Tailwind and get it as utility classes.

  • Feed your coding agent real values

    Cursor and Claude Code adapt true spacing and colors instead of estimating them from a screenshot.

  • Migrate off old CSS

    Convert the sections of a legacy site one at a time while you move it to a Tailwind codebase.

How it works

From a URL to code you can paste

  1. 1

    Send one URL

    One GET request to /v1/code with the page’s address and, if you want, the section by name.

  2. 2

    MiroMiro reads the live page

    It loads the page in a real browser and works out which CSS rule wins for each element.

  3. 3

    Get it back, ready to use

    Typed JSON, for 10 credits. A repeat call within 24 hours is free.

Three ways to use it

From your code, your agent, or n8n

The same extraction, three doors: a REST endpoint for your app, an MCP tool for ChatGPT, Claude, Cursor or Codex, and a verified n8n node for automations. One account, one credit balance.

For developers

With one API call

One REST call from any language, with your API key. Typed JSON back.

1const res = await fetch(2  'https://miromiro.app/api/v1/code?url=linear.app&framework=tailwind',3  { headers: { Authorization: `Bearer ${process.env.MIROMIRO_API_KEY}` } }4)5const data = await res.json()6789
API reference
For AI agents

Or just ask your agent

Connect once over MCP, then ask in plain words. No code.

ChatGPTClaudeClaude CodeCursorCodexand any MCP client
Setup for every agent

Rebuild the hero section of linear.app in Tailwind in my project.

Called MiroMiro · extract_code · linear.app

Done. The component uses the section's real colors, fonts and spacing. Here is a preview link to compare it with the original.

For automations

Or run it in n8n

A verified n8n node with free, ready-made templates. Make, Zapier and any tool that sends an HTTP request can call the API too.

The template for this job: Rebuild a whole page as code

  1. Run

    Click Execute

  2. Settings

    Your website

  3. MiroMiro

    Hero + find sections

  4. Split

    One per section

  5. MiroMiro

    Each section as code

  6. Zip

    One file per section

Why this one

CSS to Tailwind converters need the CSS pasted in, and screenshot tools invent the values. This reads the live page and maps what is really there.

Compare with other APIs
Parameters

What you can pass

Only url is required. Everything else narrows or reshapes the result.

urlrequired

any public URL

The page to extract from. With or without protocol (https:// is assumed).

framework

tailwind (default) · html · jsx · vue · elementor · shopify

The code you get back. tailwind returns markup with utility classes; html returns markup plus a companion stylesheet; jsx returns a React component; vue returns a single-file component.

section

hero · header · footer · pricing · features · testimonials · faq · cta

A part of the page by name, for callers that cannot see its markup (AI agents, mostly).

selector

any CSS selector

The section to extract, e.g. selector=%23hero or selector=.pricing-card - best taken from a previous response's sections list.

name

a component name

Component name for the jsx target - the identifier in "export default function ...".

theme

light (default) · dark

Which colour scheme to extract.

inline_svg

true · false (default)

Keep large inline SVGs inside code.

fields

field names

Comma-separated list of fields to return (e.g. fields=code,tokens).

render

true · false (default)

Load the page in a real browser and run its JavaScript before extracting.

fresh

true · false (default)

Skip the 24-hour cache and re-extract from the live page.

screenshot

true · full · false (default)

Requires render=true. The same real browser that renders the page also captures a screenshot - true for the 1440x900 viewport, full for the entire page height.

Every parameter, the response fields and the error codes are in the reference.

FAQ

Frequently asked questions

How does it convert CSS to Tailwind?

It resolves the page’s cascade first: every stylesheet, specificity, media queries and CSS variables. Then it maps each winning declaration to the matching utility. A value that has no stock utility becomes an arbitrary value, such as text-[#0a2540], so the result is exact rather than rounded to the nearest default.

Are responsive and hover styles included?

Yes. Media queries become sm:, md: and lg: variants, state rules become hover: and focus: variants, and a prefers-color-scheme block becomes dark: variants. Pass theme=dark to make the dark version the base.

Does the source site need to use Tailwind?

No. It works from the computed result of any CSS, whether the site was written with Tailwind, plain CSS, Sass or a CSS-in-JS library. Pages that build their styles in the browser need render=true.

What about animations?

The @keyframes a section uses come back in the css field, and the elements carry the matching animate-[…] classes. Add the keyframes to your global stylesheet.

What does it cost?

10 credits per section. Failed and blocked requests are never billed, a repeat call within 24 hours is free, and every key includes 300 free credits a month.

Does it work on sites built with JavaScript?

Yes. The page’s HTML and CSS are read first, which is enough for most sites. When a page only builds itself with JavaScript, or refuses a plain request, it is re-read in a real browser automatically at no extra cost. Add render=true to force the browser, for example for images that load on scroll: that costs 5 extra credits, on every plan including the free key.

Can it read pages behind a login?

No. It reads public pages the way a visitor without an account would see them. Pages that need a sign-in, and addresses on your own machine such as localhost, are out of reach.

Can my AI agent call it without code?

Yes. The same call is the extract_code tool on the MiroMiro MCP server. Connect ChatGPT, Claude, Cursor, Codex or another agent once, with a sign-in and no API key, and ask in plain language.

More about the Website to Tailwind API

Convert a live website to Tailwind CSS

The MiroMiro website to Tailwind API takes a URL and returns a section of that page as markup with Tailwind utility classes. It does not guess from a screenshot. It fetches the page and its stylesheets, runs the cascade to find the declaration that wins for each property on each element, and maps those declarations to utilities.

Clean output, not a class dump

Source class names, data attributes and wrapper divs that carry no styling are removed. Reset rules are left out, because Tailwind’s own base layer already provides them. What is left reads like markup a developer wrote: the structure of the section and the classes that style it.

Built for agents and pipelines

Every response also lists the other sections on the page with a selector for each, so an agent can ask for the pricing table next without seeing the markup. The design tokens the section uses come back alongside the code, ready to drop into a theme.

Related endpoints

Try it on your own URL

300 free credits a month, no credit card. One key works for every endpoint, over REST or MCP.

Get a free API key