You can now filter icon search results by “solid” and “line” styles using the Noun Project Icons API. Easily give your product users the ability to filter our entire library of over 7 million icons by solid, line, and by line weight through your Noun Project Icons API integration.
This feature is only available in the new version of our API, so be sure to upgrade for free now to use it if you haven’t already done so.
How It Works
Accessing this feature is easy with some simple adjustments. Just include values for style, line weight, or both in your URL structure.
To adjust for style, you can include line, solid, or both line and solid like in the examples below.
Filtering by line weight can be done by passing in a single integer or range of integers. The line weight ranges from 1 to 60, and represents the average line width in pixels when the icon is rendered at 512px per side. If line width throughout the icon varies too much from the average, we do not provide a value.
Keep in mind—some icons don’t fall into the ‘line’ or ‘solid’ categories and may not have specific styles assigned to them. Also, only ‘line’ icons with a consistent line weight (as described above) will include a line weight value. The option to filter icons by style and line weight is only available through the icon search endpoint in API v2.
For example, if you wanted to search for “dog” icons in the “line” style, you could construct your usual search query, then specify the style in the query like this:
https://api.thenounproject.com/v2/icon?query=dog&styles=line
If you wanted to take it a step further and specify the line weight, you can simply add line_weight to the query, like so:
https://api.thenounproject.com/v2/icon?query=dog&styles=line&line_weight=18-20
You can also search multiple styles at once. For example, if you wanted to search for “cat” icons in both “solid” and “line” styles, you could form your request to include both like this:
https://api.thenounproject.com/v2/icon?query=cat&styles=line,solid
Additional Examples:
GET https://api.thenounproject.com/v2/icon?query=dog&styles=line
GET https://api.thenounproject.com/v2/icon?query=dog&styles=solid
GET https://api.thenounproject.com/v2/icon?query=dog&styles=line,solid
GET https://api.thenounproject.com/v2/icon?query=cat&styles=line&line_weight=20
GET https://api.thenounproject.com/v2/icon?query=cat&styles=solid,line&line_weight=20
GET https://api.thenounproject.com/v2/icon?query=cat&line_weight=20
GET https://api.thenounproject.com/v2/icon?query=cat&line_weight=18-20
Ready to Get Started?
This new, highly requested filter feature leverages AI technology to save time by finding icons that match – but it’s only available with a free upgrade to the Icons API v2. To upgrade to the new version of the Icon API, just follow the easy steps in this migration guide.
If you have any questions, please contact us at info@thenounproject.com.