Skip to content
Documentation

Car Image API quickstart

One call, your first image in a minute.

1. Get an API key

Sign in and you start on Free: 30 free vehicle images and 100 credits for quality upgrades, no card. The dashboard opens on your first key, already filled into a request you can run from the page. Or let the CLI make one through a browser-approved device code:

bash
npx @meterapp/car-image login

2. Request an image

One call, three parameters: make, model and year name any vehicle in the catalog. Add view for one of nine angles and color for any paint when you need them. In production, look each vehicle up once and store its veh_… id (Vehicles & search).

Building a web page? Start with the HTML and React examples below: create a signed URL for the browser. Use the byte request here when you want to download a file.

bash
curl --fail-with-body \
  -H "Authorization: Bearer $CAR_IMAGE_API_KEY" \
  "https://carimage.dev/api/v1/images/car?make=porsche&model=911&year=2024" \
  --output porsche-911.png

The bytes come back in the response. The first image of a vehicle nobody has requested typically takes under 20 seconds; it is then stored for good, and every later request for it is served from that stored copy in about a second, and it does not count again that month. That first image is standard quality, and its view is redrawn at enhanced quality in the background, usually within a day (first views).

3. Read the response headers

Every image response says what it counted and where it came from:

HeaderExampleMeaning
X-Vehicle-Images-Used1Vehicle images your plan has counted this month; X-Vehicle-Images-Included is the allowance.
X-Image-Sourcecachecache (the image was ready) or generated (we prepared it for this request); it counts the same either way.
ETag"9f2a…c41d"Send it back as If-None-Match: an unchanged image answers 304 and costs nothing.
X-Request-Idreq_01j…Quote it when you write to support.

4. Show the image in HTML or React

A signed delivery URL works as an ordinary image source in HTML and React. No browser SDK is needed. Your server or build step creates it with POST /api/v1/image-urls; only the returned data[0].url reaches the page. Look the vehicle up first and store its vehicle id.

Server or build step · create the URL once
curl --fail-with-body \
  -X POST https://carimage.dev/api/v1/image-urls \
  -H "Authorization: Bearer $CAR_IMAGE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: listing-911-hero-v1" \
  -d '{"images":[{"vehicle":"veh_78qtwrgh37bkr","view":"front-3-4","width":600,"height":400,"trim":true,"format":"auto"}],"ttl_seconds":604800}'
HTML · paste the returned URL
<!-- Replace SIGNED_DELIVERY_URL with the complete data[0].url from your server. -->
<img
  src="SIGNED_DELIVERY_URL"
  alt="2024 Porsche 911, front three-quarter view"
  width="600" height="400"
  loading="lazy" decoding="async"
  style="max-width: 100%; height: auto;"
>
React · pass the returned URL as a prop
// Pass the complete data[0].url from your server as src.
// Works in React, including Vite apps and Next.js Client Components.
export function CarImage({ src, alt }: { src: string; alt: string }) {
  return (
    <img
      src={src} alt={alt}
      width={600} height={400}
      loading="lazy" decoding="async"
      style={{ maxWidth: "100%", height: "auto" }}
    />
  );
}

// deliveryUrl is the signed URL your server returned and stored.
<CarImage src={deliveryUrl} alt="2024 Porsche 911, front three-quarter view" />

Keep the API key on the server. Reuse the URL; do not create one during React client rendering or in a browser effect. Creating a URL counts its vehicle image once, like any delivery of it that month; repeated loads are free until expires_at. This example requests a seven-day lifetime. Replace it before expiry, or choose auto-renewal for longer-lived pages (a renewal counts the image once for the month it lands in). Set image options when creating the URL; use the returned URL unchanged.

In Next.js the whole loop is one Server Component you can copy from the React guide, which also covers caching and placeholders. For static HTML, follow Pages without a backend.

5. Pick your guide