Getting Started¶
Creating an API Key¶
Access to the API is available to everyone with a Noun Project account (including users with Playground accounts). Once you have logged in, visit the app management page to generate a new API key or manage existing keys. It is important that you treat this key as if it were a secret password. With an API key and secret, anyone can access endpoints from your account.
Authentication¶
The API is secured with OAuth 1.0a. You must use your client key and secret to sign requests when accessing the API. There are many established libraries that will take care of authenticating calls for you. There is no need to provide an access token as our API endpoints do not yet support granting access to a users private data.
For more examples, please view our sample code.
Note
Nonce must be a minimum of 8 characters in length.
Making Requests¶
After authenticating, you can make requests. To make a request you simply need to point to
https://api.thenounproject.com
. It’s really that simple!For reference, here is a list of our public API endpoints, API Explorer, and sample code.
Supported File Formats and HTTP Responses¶
Every request will return a JSON response or an error response.
Examples:
200 Success
- returns data as JSON in the response body.
404 Not Found
- may return extra error description in response body.
401 Unauthorized
- may return extra error description in response body.
Pricing¶
We have plans of all sizes, and can customize plans to meet your needs. Please visit the developers page for more information on our API pricing.
Unacceptable Uses¶
The Noun Project API is designed to empower developers with a visual language. Using the Noun Project API inappropriately will result in the review and removal of your API keys.
This includes but is not limited to:
Distributing icons.
Reselling content.
Exploiting The Noun Project users or content.
Replicating The Noun Project.
Sample Code¶
Python
import requests
from requests_oauthlib import OAuth1
auth = OAuth1("your-api-key", "your-api-secret")
endpoint = "https://api.thenounproject.com/v2/icon/1"
response = requests.get(endpoint, auth=auth)
print(response.content)
Ruby
require "oauth"
consumer = OAuth::Consumer.new("your-api-key", "your-api-secret")
access_token = OAuth::AccessToken.new consumer
endpoint = "https://api.thenounproject.com/v2/icon/1"
response = access_token.get(endpoint)
puts response.body
Additional Examples
Icon Style Filtering¶
Icon search results can be filtered by style. Valid styles currently include “solid” and “line”. This can be done by passing in a single style (style=solid) or multiple styles separated by a comma (style=solid,line) as a query parameter.
You can also filter icon search results that are of the style “line” by line weight. This can be done by passing in a single integer value (line_weight=x), or a range of values represented by two integers separated by a dash (line_weight=x-y), as a query parameter.
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.
Note
Some icons are neither line nor solid and may not have a style associated.
Only “line” icons with a consistent line weight as described above will have a line weight value.
Available in API v2 only (not in legacy v1 endpoints).
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
V1 Documentation & Explorer¶
Note
Our older V1 API endpoints are still accessible if you previously had access. However, they are no longer being updated and we recommend transitioning to using our newer V2 API endpoints instead.