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
- Sign in to your Hugeicons account at hugeicons.com (opens in a new tab)
- Navigate to your dashboard
- Go to the "Licenses" tab
- 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
Parameter | Type | Description |
---|---|---|
page | integer | Page number for pagination (default: 1) |
per_page | integer | Number of items per page (default: 20) |
q | string | Search query to filter icons |
list_all | boolean | If 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
Parameter | Type | Description |
---|---|---|
name | string | Name of the icon |
Query Parameters
Parameter | Type | Description |
---|---|---|
style | string | Icon style (e.g., stroke, fill) |
Get Icon SVG
Retrieve the SVG content of a specific icon.
Request
GET /v1/icon/:name/svg
Query Parameters
Parameter | Type | Description |
---|---|---|
style | string | Icon 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
Parameter | Type | Description |
---|---|---|
category | string | Category name or slug |
Query Parameters
Parameter | Type | Description |
---|---|---|
page | integer | Page number for pagination (default: 1) |
per_page | integer | Number of items per page (default: 20) |
list_all | boolean | If true, returns all icons without pagination |
Search API
Search for icons using various criteria and filters.
Request
GET /v1/search
Query Parameters
Parameter | Type | Description |
---|---|---|
q | string | Search query for name or tags |
category | string | Filter by category |
page | integer | Page number for pagination (default: 1) |
per_page | integer | Number of items per page (default: 20) |
sort | string | Sort 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 hourX-RateLimit-Remaining
: The number of requests remaining in the current time windowX-RateLimit-Reset
: The time when the rate limit will reset, in Unix epoch seconds
Error Codes
Status Code | Description |
---|---|
400 | Bad Request - Invalid parameters |
401 | Unauthorized - Invalid or missing API key |
404 | Not Found - Resource not found |
429 | Too Many Requests - Rate limit exceeded |
500 | Internal 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);
?>