download_icon_by_id
Download icons from Freepik by their unique ID in various formats and sizes for integration into projects.
Instructions
Download the specified icon by its unique ID in the requested format and size.
Path Parameters:
id (Required): Icon resource ID
Query Parameters:
format: These are the formats available for download
Note: gif, mp4, aep, json, psd and eps are not available for standard and sticker icon types.
png_size: These are the sizes available for png_url formats.
Note: Only apply to format png.
Responses:
200 (Success): OK
Content-Type:
application/jsonResponse Properties:
Example:
400: Bad Request - The server could not understand the request due to invalid syntax.
Content-Type:
application/jsonResponse Properties:
Example:
401: Unauthorized - The client must authenticate itself to get the requested response.
Content-Type:
application/jsonResponse Properties:
Example:
403: Forbidden - The client does not have permission to access the requested resource.
Content-Type:
application/jsonResponse Properties:
Example:
404: Not Found - The server can not find the requested resource.
Content-Type:
application/jsonResponse Properties:
Example:
429: Too Many Requests - The client has sent too many requests in a given amount of time.
Content-Type:
application/jsonResponse Properties:
Example:
500: Internal Server Error - The server has encountered a situation it doesn't know how to handle.
Content-Type:
application/jsonResponse Properties:
Example:
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| Accept-Language | No | Specifies the search query language using the ISO 639-1 (2-letter language code) and the ISO 3166-1 (2-letter country code) for language variants. The API will use "en-US" as a default language for processing if a code is not provided, or does not exist. | |
| id | Yes | Icon resource ID | |
| format | No | These are the formats available for download - Note: gif, mp4, aep, json, psd and eps are not available for standard and sticker icon types. | |
| png_size | No | These are the sizes available for png_url formats. - Note: Only apply to format png. |
Implementation Reference
- src/application/route_configuration.py:28-35 (registration)Registers all GET/POST endpoints matching /v1/icon.* as MCP tools. This exposes the Icons API, including the download_icon_by_id tool generated from the OpenAPI specification.RouteMap( methods=[ "GET", "POST", ], pattern=r"/v1/icon.*", mcp_type=MCPType.TOOL, ),
- src/application/server_factory.py:84-90 (registration)Instantiates the FastMCP server from the loaded OpenAPI spec and route maps, automatically generating and registering tools (including download_icon_by_id) that proxy requests to the Freepik API via the configured HTTP client.server = FastMCP.from_openapi( openapi_spec=openapi_spec, client=http_client, name=server_config.name, route_maps=route_maps, mcp_component_fn=mcp_component_fn, )
- Loads the OpenAPI specification used to generate tool schemas and handlers for the Icons API endpoints.spec_loader = OpenApiSpecLoader(cache_config) openapi_spec = spec_loader.load_spec()