> ## Documentation Index
> Fetch the complete documentation index at: https://docs.magnific.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Download an icon

> A download URL for one icon, in the format and size asked. It spends credits.



## OpenAPI

````yaml openapi/magnific-api-v2-stock-openapi.yaml GET /v2/stock/icons/{icon_id}/download
openapi: 3.1.0
info:
  title: Magnific API v2 — Stock
  version: 2.0.0
  description: >-
    Search, read and download stock under `/v2/stock`: images and templates,
    icons and videos (same items, licences and billing as API v1), and music and
    sound effects (free, as on the web).
servers:
  - url: https://api.magnific.com
    description: Production V2
security:
  - magnificApiKey: []
  - bearerAuth: []
tags:
  - name: Videos
    description: >-
      Generate and edit videos. Add `?dry_run=true` to get the price of a
      request first.
paths:
  /v2/stock/icons/{icon_id}/download:
    get:
      tags:
        - Icons
      summary: Download an icon
      description: |-
        A download link for the icon. Charges the download as on /v1.

        A personal token needs `api:write`.
      operationId: stock_icons_icon_id_download
      parameters:
        - description: >
            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.
          example: en-US
          in: header
          name: Accept-Language
          required: false
          schema:
            type: string
        - description: Icon resource ID
          example: 30955
          in: path
          name: icon_id
          required: true
          schema:
            type: integer
        - description: >
            These are the formats available for download

            - Note: gif, mp4, aep, json, psd and eps are not available for
            standard and sticker icon types.
          example: svg
          in: query
          name: format
          schema:
            enum:
              - svg
              - png
              - gif
              - mp4
              - aep
              - json
              - psd
              - eps
            type: string
        - description: |
            These are the sizes available for png_url formats.
            - Note: Only apply to format png.
          in: query
          name: png_size
          schema:
            default: 512
            enum:
              - 512
              - 256
              - 128
              - 64
              - 32
              - 24
              - 16
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/Stockdata_icon_download_data'
                required:
                  - data
        '400':
          description: >-
            `validation_failed`: a parameter is not valid (`details.errors` by
            field, e.g. `query`, `cursor`, `filters.color`).
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '401':
          description: '`unauthenticated`: the token or API key is missing or not valid.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '402':
          description: '`insufficient_credits`: not enough credits for the download.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '403':
          description: >-
            `forbidden`, `upgrade_required` (a premium asset on a plan without
            premium), `restricted_author_content`, `magnific_api_disabled`,
            `key_not_supported` or `api_key_wallet_unavailable`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '404':
          description: '`not_found`: no such asset.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '422':
          description: >-
            `validation_failed`: the API key is not linked to an active
            subscription, or the tool is not available.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '429':
          description: '`rate_limited`: too many requests or downloads.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '500':
          description: '`internal_error`.'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
        '503':
          description: >-
            `service_unavailable`: the search engine or a dependency is down;
            retry later.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StockV2Error'
      security:
        - magnificApiKey: []
        - bearerAuth: []
components:
  schemas:
    Stockdata_icon_download_data:
      example:
        filename: filename
        url: https://www.example.com/audit-report.zip
      properties:
        filename:
          type: string
        url:
          format: uri
          type: string
      type: object
    StockV2Error:
      type: object
      required:
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            Stable, for code: `validation_failed`, `unauthenticated`,
            `insufficient_credits`, `forbidden`, `upgrade_required`,
            `not_found`, `rate_limited`, `internal_error`,
            `service_unavailable`...
          example: validation_failed
        message:
          type: string
          description: For people. Never the cause of a server error.
        details:
          type: object
          description: Absent on a server error.
          properties:
            errors:
              type: object
              description: Validation messages by field.
              additionalProperties:
                type: array
                items:
                  type: string
        request_id:
          type: string
  securitySchemes:
    magnificApiKey:
      type: apiKey
      in: header
      name: x-magnific-api-key
      description: >-
        Your Magnific API key. [Learn how to obtain an API
        key](https://docs.magnific.com/quickstart)
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        A personal access token, sent as `Authorization: Bearer <token>`. [How
        to get one](/api-reference/v2/overview#get-a-personal-access-token)

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.