Iconify API queries
This tutorial is for developers that want to create their own tools to access Iconify API.
Iconify API supports the following basic queries:
- dynamically generates SVG.
- dynamically generates CSS for icons.
- retrieves icon data.
- returns last modification time of requested icon sets, which can be used to invalidate old icon data cache.
If list of icons is enabled, custom icon pickers can use the following queries to browse icons:
If search engine is enabled, icon pickers can implement search functionality using these queries:
- returns list of icons that match keyword.
- or returns list of keywords that contain requested keyword, which can be used for autocomplete.
- shows API version as plain text, unless disabled. If you are running multiple API servers, like public Iconify API does, this can be used to check which server visitor is connected to.
- updates icon sets from its source without restarting API. This can be used to automatically keep API up to date using GitHub hooks or similar methods.
In code samples some queries above are marked as API v2, some as API v3.
- API v2 queries existed since version 2 of Iconify API, but were not documented. They are supported and will continue being supported, but at some point improved v3 versions of same queries can be added.
- API v3 queries are available since version 3 of Iconify API.
You can use both versions at the same time. Improved versions of old queries might be added to solve various issues, but no need to switch to new version right away, old versions will continue to be supported.
API even supports v1 queries that aren't documented and should not be used. They are supported because they can still be found in some legacy applications, such as older versions of Iconify plug-in for Sketch.
All queries that return JSON data have one common parameter:
- pretty is used to format JSON data, making it easy to read. Set to 1 or true to enable.