ProductFeatured

InstantGradient Now Has a REST API

Ugo L.Ugo L.
April 17, 20264 min read

A Pro user emailed me last week asking if he could generate palettes from his own app instead of copy-pasting hex codes from the site. Fair question. I had been thinking about it since I started building the palette directory, and it pushed me to finally ship it.

InstantGradient now has a REST API. Six endpoints, JSON responses, one API key, and you are up in under a minute.

What you can do with it

The API gives you programmatic access to everything the site already does:

  • Generate a palette on the fly, same algorithm as hitting spacebar in the generator
  • Look up any color by hex code, with name, family, RGB/HSL/OKLCH conversions, and page link
  • Search colors by name or family (Red, Blue, Purple, etc.)
  • Browse community palettes sorted by popular or recent, filtered by tags
  • Look up a specific palette by slug
  • Check your account for key status and remaining credits

Every endpoint returns JSON in a consistent envelope with a request ID, credit usage, and remaining balance. Full reference in the API docs.

What comes back

Here is what a single request to /v1/palette/generate returns:

curl https://instantgradient.com/api/v1/palette/generate \
  -H "Authorization: Bearer ig_your_key_here"
{
  "data": {
    "colors": ["fff2ef", "ffdbb6", "f7a5a5", "5d688a"],
    "info": {
      "name": "Blush Linen Dusk",
      "slug": "blush-linen-dusk-1d7a",
      "description": "Soft warmth receding into cool shadow, like afternoon light filtering through vintage linen and aged plaster."
    },
    "stats": { "saves": 143 },
    "links": {
      "page": "https://instantgradient.com/palette/blush-linen-dusk-1d7a",
      "generator": "https://instantgradient.com/app/fff2ef-ffdbb6-f7a5a5-5d688a"
    }
  },
  "meta": {
    "credits_used": 1,
    "credits_remaining": 499,
    "daily_limit": 500
  }
}
Open

One request, one harmonious palette, and everything you need to render or link back to it. Load as a CSS background, a Paper shader like above, or however else you prefer.

In code

const res = await fetch(
  "https://instantgradient.com/api/v1/palette/generate?size=6",
  { headers: { Authorization: "Bearer ig_your_key_here" } }
);
const { data } = await res.json();
console.log(data.colors); // ["264653", "2a9d8f", ...]

The size parameter controls how many colors you get back (2 to 8). Color search works the same way:

curl "https://instantgradient.com/api/v1/colors?q=midnight&limit=5" \
  -H "Authorization: Bearer ig_your_key_here"

Returns matching colors with names, families, and conversions. You can filter by family too (?families=Blue,Purple).

What people build with this

I use the API on Mokkit, my other project, to pull curated palettes and generate gradient backgrounds automatically. That was the first real integration, and the reason I prioritized palette generation as an endpoint.

Beyond that, the API fits anywhere color data shows up in a product:

  • Design tools and plugins that need a palette picker or color library without building one from scratch
  • Component libraries and theme generators that pull harmonious palettes for design systems
  • Content platforms that auto-generate header backgrounds or social cards from color data
  • Portfolio builders and website generators that offer preset gradient themes to users

The color lookup endpoint is useful on its own. If your app displays a hex code anywhere, you can enrich it with a name, family, and conversion data in one call.

How to get started

  1. You need a Pro subscription (API access is included)
  2. Go to your dashboard and generate an API key
  3. Make your first request

That is it. 500 credits per day, which covers most use cases. List endpoints charge one credit per item returned, so fetching 10 palettes costs 10 credits.

Included with Pro. First request in 30 seconds.

Generate your API key

The API documentation covers every endpoint with parameters, example responses, and error codes. If something is missing or you want an endpoint that does not exist yet, email me at ugo@instantgradient.com.

Keep reading

Your next gradient is one spacebar away

Free, no account needed. Just open and start creating.

Start creating

Tags

APIColor Palette APIDeveloper ToolsREST APIPalettes