Skip to content

Repository files navigation

Icons API

Icons API is a Laravel application that exposes a public, read-only endpoint for browsing an icon library — searching by keyword and filtering by icon library or brand status.

Endpoint

GET /api/icons

Public, unauthenticated, CORS-enabled for any origin. Returns a paginated list of icons.

Query parameters

Parameter Description
keyword Full-text search against each icon's name and keywords.
filters[i][name] Column to filter by — library or is_brand.
filters[i][value] Value to filter by.
filters[i][active] Set to true to apply the filter.
per_page Results per page (capped at 100).
sortField / sortDirection Field and direction (asc/desc) to sort by.

Example

GET /api/icons?keyword=home&filters[0][name]=library&filters[0][value]=fontawesome&filters[0][active]=true&per_page=20

Response

{
    "status": 200,
    "message": "1 items found",
    "data": {
        "countItems": 1,
        "result": {
            "data": [
                {
                    "id": 1,
                    "slug": "fontawesome.home",
                    "library": "fontawesome",
                    "is_brand": false,
                    "name": "home",
                    "tag": "dile-fontawesome-icon-home",
                    "import": "@dile/iconlib/fontawesome-icons/home.js",
                    "svg": "<svg ...></svg>",
                    "keywords": ["house", "residence"]
                }
            ]
        }
    }
}

Each icon includes its raw svg markup alongside descriptive metadata (library, is_brand, name, tag, import, keywords).

Tech stack

Local setup

composer install
cp .env.example .env
php artisan key:generate

Configure your database credentials in .env, then run:

php artisan migrate

If you're using Laravel Sail:

./vendor/bin/sail up -d
./vendor/bin/sail artisan migrate

Testing

php artisan test

About

Api icon library catalog

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages