API Reference

API Reference

The Hugeicons API provides programmatic access to our extensive icon library, allowing you to integrate our icons directly into your applications.

Try it on Swagger UI ↗ (opens in a new tab)

Interactive API documentation with Swagger UI. Test endpoints directly in your browser.

Download Postman Collection ↓

Get our Postman collection to test the API in your local environment.

Features

  • Retrieve icon metadata and SVG content
  • Search through our icon collection
  • Access icon categories
  • Get icon variations and styles

Base URL

All API requests should be made to:

https://api.hugeicons.com

API Versions

The current version of the API is v1. All endpoints are prefixed with /v1/.

Authentication

The Hugeicons API uses API keys to authenticate requests. You need to include your API key in the header of every request.

Getting an API Key

  1. Sign in to your Hugeicons account at hugeicons.com (opens in a new tab)
  2. Navigate to your dashboard
  3. Go to the "Licenses" tab
  4. Use your Universal license token as your API key

Using Your API Key

Include your API key in the x-api-key header with every request:

curl -X GET "https://api.hugeicons.com/v1/icons" \
  -H "x-api-key: your-api-key-here"

API Key Security

To keep your API key secure:

  • Never share your API key publicly or commit it to version control
  • Use environment variables to store your API key
  • Rotate your API key periodically
  • Use different API keys for development and production environments

Icons API

List All Icons

Retrieve a paginated list of all icons with optional filtering.

Request

GET /v1/icons

Query Parameters

ParameterTypeDescription
pageintegerPage number for pagination (default: 1)
per_pageintegerNumber of items per page (default: 20)
qstringSearch query to filter icons
list_allbooleanIf true, returns all icons without pagination

Example Request

curl -X GET "https://api.hugeicons.com/v1/icons?page=1&per_page=20&q=search" \
  -H "x-api-key: your-api-key-here"

Get Icon Details

Retrieve detailed information about a specific icon.

Request

GET /v1/icon/:name

Path Parameters

ParameterTypeDescription
namestringName of the icon

Query Parameters

ParameterTypeDescription
stylestringIcon style (e.g., stroke, fill)

Get Icon SVG

Retrieve the SVG content of a specific icon.

Request

GET /v1/icon/:name/svg

Query Parameters

ParameterTypeDescription
stylestringIcon style (defaults to stroke-rounded if no hyphen is present)

Categories API

List All Categories

Retrieve a list of all available icon categories.

Request

GET /v1/categories

Get Icons by Category

Retrieve all icons belonging to a specific category.

Request

GET /v1/icons/category/:category

Path Parameters

ParameterTypeDescription
categorystringCategory name or slug

Query Parameters

ParameterTypeDescription
pageintegerPage number for pagination (default: 1)
per_pageintegerNumber of items per page (default: 20)
list_allbooleanIf true, returns all icons without pagination

Search API

Search for icons using various criteria and filters.

Request

GET /v1/search

Query Parameters

ParameterTypeDescription
qstringSearch query for name or tags
categorystringFilter by category
pageintegerPage number for pagination (default: 1)
per_pageintegerNumber of items per page (default: 20)
sortstringSort order (relevance, name_asc, name_desc)

Search Features

  • Fuzzy Matching: The search engine supports fuzzy matching, so minor typos and variations in spelling will still return relevant results.
  • Tag-based Search: Search through icon tags to find icons based on concepts and use cases.
  • Category Filtering: Narrow down results to specific categories.
  • Sorting Options: Sort results by relevance or alphabetically.

Response Format

All responses are returned in JSON format. SVG content is returned as a string within the JSON response.

Success Response Example

{
  "data": {
    "id": "search-01",
    "name": "Search",
    "category": "Interface",
    "styles": ["stroke", "fill"],
    "tags": ["search", "find", "magnifier"]
  }
}

Error Response Example

{
  "error": {
    "code": "error_code",
    "message": "A human-readable error message"
  }
}

Rate Limiting

The API implements rate limiting to ensure fair usage. Rate limits vary based on your subscription plan. Rate limit information is included in the response headers:

  • X-RateLimit-Limit: The maximum number of requests allowed per hour
  • X-RateLimit-Remaining: The number of requests remaining in the current time window
  • X-RateLimit-Reset: The time when the rate limit will reset, in Unix epoch seconds

Error Codes

Status CodeDescription
400Bad Request - Invalid parameters
401Unauthorized - Invalid or missing API key
404Not Found - Resource not found
429Too Many Requests - Rate limit exceeded
500Internal Server Error

Code Examples

JavaScript/Node.js

const apiKey = process.env.HUGEICONS_API_KEY;
 
fetch('https://api.hugeicons.com/v1/icons', {
  headers: {
    'x-api-key': apiKey
  }
})
.then(response => response.json())
.then(data => console.log(data));

Python

import requests
import os
 
api_key = os.environ.get('HUGEICONS_API_KEY')
 
headers = {
    'x-api-key': api_key
}
 
response = requests.get('https://api.hugeicons.com/v1/icons', headers=headers)
data = response.json()

PHP

<?php
$api_key = getenv('HUGEICONS_API_KEY');
 
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.hugeicons.com/v1/icons');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'x-api-key: ' . $api_key
]);
 
$response = curl_exec($ch);
$data = json_decode($response, true);
curl_close($ch);
?>