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

# Get download links for a post's media

> Read a public social post and get its text, author and a download link for each photo, video and sound.

> [!NOTE]
>
> Needs `media:read`. See [Permissions](https://docs.postsyncer.com/essentials/authentication.md#permissions).

Send the link of a public post on Instagram, TikTok, YouTube, Facebook, X, Threads, LinkedIn, Pinterest, Bluesky, Reddit, Vimeo or another site. The post needn't be yours. The answer has its text, its author, and its files by kind in `medias`, each with a download link.

Nothing is stored. To keep a file, send its `url` to [Import media from links](https://docs.postsyncer.com/api-reference/media/upload-url.md). The links work for a few hours at most, until `expires_at`. The same post read again within a minute gives the same answer, with fresh links.

`warnings` says what to know about the answer:

| `code` | What it means |
| - | - |
| `no_media` | The post is only text. |
| `photos_incomplete` | Only some of the photos could be read. |
| `photo_low_resolution` | Some photos are only available small. |
| `truncated` | Only the first files are included. |

In MCP this is the `download-media-from-url` tool: see [Media tools](https://docs.postsyncer.com/mcp/tools-reference.md#media).

## Errors

A post that can't be read answers with `message` and a `code`.

| Status | `code` | When | Retry? |
| - | - | - | - |
| 401 | | No API key, or not a valid one. | No: fix the key. |
| 403 | | The key lacks `media:read`, or its user is inactive. | No: grant it in Settings → API. |
| 404 | `post_unavailable` | The post is private, was removed, or doesn't exist. | No. |
| 422 | | `url` is missing or isn't a link. | No: fix the request. |
| 422 | `invalid_url`, `blocked_address`, `login_required`, `geo_restricted`, `link_expired`, `unsupported_url`, `no_media`, `live_not_supported`, `file_too_large`, `platform_error` | The post can't be downloaded; `message` says why. | No, except `live_not_supported`: try again after the live ends. |
| 429 | | More than 60 requests a minute. | Yes, after `Retry-After` seconds. |
| 503 | `unavailable` | The downloader can't read posts right now. | Yes, after `Retry-After` seconds. |

## Related

* [Import media from links](https://docs.postsyncer.com/api-reference/media/upload-url.md): store a file from the answer.
* [Analyze a video with AI](https://docs.postsyncer.com/api-reference/media/analyze-video.md): what a post's video says and shows.


## OpenAPI

````yaml POST /media/download/url
openapi: 3.0.3
info:
  title: PostSyncer API
  description: >-
    Post to 12 social networks from your code: posts, media, comments,
    analytics, webhooks and more.
  version: 1.0.0
servers:
  - url: https://postsyncer.com/api/v1
security:
  - bearerAuth: []
tags:
  - name: Workspaces
    description: The workspaces the key can reach.
  - name: Accounts
    description: Connected social accounts, links to connect more, and disconnecting them.
  - name: Posts
    description: Drafts, scheduled and published posts, approvals and a post's history.
  - name: Post settings
    description: A post's auto-plug, comment moderation and contact collection.
  - name: Media
    description: >-
      The media library: file uploads, URL imports, and reading videos and
      social posts' files.
  - name: Folders
    description: Folders that organise the media library.
  - name: Comments
    description: >-
      Comments on your posts: reading, replying, editing, hiding, deleting and
      syncing them.
  - name: Reviews
    description: Google Business Profile reviews and your replies to them.
  - name: Analytics
    description: Workspace, account and post performance.
  - name: Brand
    description: >-
      A workspace's brand: identity, voice, look, accounts, competitors,
      learnings and rules.
  - name: Labels
    description: Labels used to tag posts.
  - name: Campaigns
    description: Campaigns used to group posts.
  - name: Snippets
    description: Saved snippets and hashtag groups to drop into posts.
  - name: Webhooks
    description: Signed webhook endpoints that get your notification events.
paths:
  /media/download/url:
    post:
      tags:
        - Media
      summary: Get download links for a post's media
      description: >-
        Needs `media:read`. Reads a public social post by its link (Instagram,
        TikTok, YouTube, Facebook, X, Threads, LinkedIn, Pinterest, Bluesky,
        Reddit, Vimeo and more; the post needn't be yours) and answers its text,
        author and a download link for each photo, video and sound. Nothing is
        stored: to keep a file, send its link to [Import media from
        links](/api-reference/media/upload-url). The links work for a few hours
        at most (`expires_at`). The same post read again within a minute gives
        the same answer, with fresh links.
      operationId: downloadMediaFromUrl
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - url
              properties:
                url:
                  type: string
                  format: uri
                  maxLength: 2048
                  description: The post's public link.
            examples:
              default:
                summary: An Instagram post
                value:
                  url: https://www.instagram.com/p/C0ffeeSpr1ng/
              tiktok:
                summary: A TikTok video
                value:
                  url: >-
                    https://www.tiktok.com/@haldencoffee/video/7345678901234567890
      responses:
        '200':
          description: The post and its files.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaDownload'
              examples:
                default:
                  summary: An Instagram post with two photos
                  value:
                    url: https://www.instagram.com/p/C0ffeeSpr1ng/
                    source: instagram
                    title: >-
                      Our spring menu starts today. The lavender oat latte is
                      back, and so is the rhubarb bun.
                    text: null
                    author: Halden Coffee
                    author_username: haldencoffee
                    author_url: https://www.instagram.com/haldencoffee/
                    published_at: '2030-03-15T09:00:00+00:00'
                    thumbnail: >-
                      https://postsyncer.com/api/downloads/DOWNLOAD_TOKEN/haldencoffee-spring-1.jpg?expires=1899817200&signature=SIGNATURE
                    duration: null
                    error: false
                    medias:
                      images:
                        - id: media_0
                          index: 0
                          url: >-
                            https://postsyncer.com/api/downloads/DOWNLOAD_TOKEN/haldencoffee-spring-1.jpg?expires=1899817200&signature=SIGNATURE
                          type: image
                          extension: jpg
                          mime_type: image/jpeg
                          filename: haldencoffee-spring-1.jpg
                          quality: original
                          width: 1080
                          height: 1350
                          duration: null
                          thumbnail: null
                          expires_at: '2030-03-15T15:00:00+00:00'
                          mp3_url: null
                          has_no_audio: false
                        - id: media_1
                          index: 1
                          url: >-
                            https://postsyncer.com/api/downloads/DOWNLOAD_TOKEN/haldencoffee-spring-2.jpg?expires=1899817200&signature=SIGNATURE
                          type: image
                          extension: jpg
                          mime_type: image/jpeg
                          filename: haldencoffee-spring-2.jpg
                          quality: original
                          width: 1080
                          height: 1350
                          duration: null
                          thumbnail: null
                          expires_at: '2030-03-15T15:00:00+00:00'
                          mp3_url: null
                          has_no_audio: false
                      videos: []
                      audio: []
                    warnings: []
                    expires_at: '2030-03-15T15:00:00+00:00'
                tiktok:
                  summary: A TikTok video
                  value:
                    url: >-
                      https://www.tiktok.com/@haldencoffee/video/7345678901234567890
                    source: tiktok
                    title: Three steps to a better pour-over at home
                    text: null
                    author: Halden Coffee
                    author_username: haldencoffee
                    author_url: https://www.tiktok.com/@haldencoffee
                    published_at: '2030-03-12T17:30:00+00:00'
                    thumbnail: >-
                      https://postsyncer.com/api/downloads/DOWNLOAD_TOKEN/haldencoffee-pour-over.jpg?expires=1899817200&signature=SIGNATURE
                    duration: 42.6
                    error: false
                    medias:
                      images: []
                      videos:
                        - id: media_0
                          index: 0
                          url: >-
                            https://postsyncer.com/api/downloads/DOWNLOAD_TOKEN/haldencoffee-pour-over.mp4?expires=1899817200&signature=SIGNATURE
                          type: video
                          extension: mp4
                          mime_type: video/mp4
                          filename: haldencoffee-pour-over.mp4
                          quality: 1080p
                          width: 1080
                          height: 1920
                          duration: 42.6
                          thumbnail: >-
                            https://postsyncer.com/api/downloads/DOWNLOAD_TOKEN/haldencoffee-pour-over.jpg?expires=1899817200&signature=SIGNATURE
                          expires_at: '2030-03-15T15:00:00+00:00'
                          mp3_url: >-
                            https://postsyncer.com/api/downloads/DOWNLOAD_TOKEN/haldencoffee-pour-over.mp3?expires=1899817200&signature=SIGNATURE
                          has_no_audio: false
                      audio: []
                    warnings: []
                    expires_at: '2030-03-15T15:00:00+00:00'
        '401':
          $ref: '#/components/responses/Unauthorized401'
        '403':
          description: The key lacks `media:read`, or its user is inactive.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              examples:
                missing_permission:
                  summary: The key lacks media:read
                  value:
                    message: >-
                      This API key does not have the "media:read" permission.
                      Edit the key in PostSyncer under Settings → API to grant
                      it.
                inactive_account:
                  summary: The key's user is inactive
                  value:
                    message: Your account is inactive.
        '404':
          description: The post is private, was removed, or doesn't exist.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaDownloadError'
              examples:
                post_unavailable:
                  summary: The post can't be read
                  value:
                    message: The post is private, was removed, or does not exist.
                    code: post_unavailable
        '422':
          description: >-
            `url` is missing or isn't a link, or the post can't be downloaded
            (`code` says why). Trying the same link again gives the same answer.
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/ValidationError'
                  - $ref: '#/components/schemas/MediaDownloadError'
              examples:
                url:
                  summary: Not a link
                  value:
                    message: The url field must be a valid URL.
                    errors:
                      url:
                        - The url field must be a valid URL.
                login_required:
                  summary: The post needs a login
                  value:
                    message: The platform only shows this post to logged-in users.
                    code: login_required
                unsupported_url:
                  summary: A site that can't be read
                  value:
                    message: Posts from this site can't be downloaded.
                    code: unsupported_url
                no_media:
                  summary: A post with no files
                  value:
                    message: >-
                      The post has no photo, video or sound that can be
                      downloaded.
                    code: no_media
        '429':
          $ref: '#/components/responses/RateLimited429'
        '503':
          description: >-
            The downloader can't read posts right now. Try again after
            `Retry-After` seconds.
          headers:
            Retry-After:
              description: >-
                Seconds to wait before trying again (when the downloader is
                unavailable).
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MediaDownloadError'
              examples:
                unavailable:
                  summary: The downloader is unavailable
                  value:
                    message: The downloader is unavailable right now, try again later.
                    code: unavailable
components:
  schemas:
    MediaDownload:
      type: object
      description: What a public social post holds, with a download link for each file.
      required:
        - url
        - source
        - title
        - text
        - author
        - author_username
        - author_url
        - published_at
        - thumbnail
        - duration
        - error
        - medias
        - warnings
        - expires_at
      properties:
        url:
          type: string
          nullable: true
          description: The post's link, as the network gives it.
        source:
          type: string
          nullable: true
          description: >-
            The network or site, like `instagram`, `tiktok`, `x`, `youtube`,
            `facebook`, `threads`, `linkedin`, `pinterest`, `bluesky`, `reddit`,
            `vimeo`, `soundcloud`, `twitch`, `dailymotion` or `telegram`.
        title:
          type: string
          nullable: true
          description: The post's title, or its text when it has no title.
        text:
          type: string
          nullable: true
          description: >-
            The post's text when it also has a title; null otherwise (the text
            is then in `title`).
        author:
          type: string
          nullable: true
          description: The author's name, or their handle when the name isn't known.
        author_username:
          type: string
          nullable: true
        author_url:
          type: string
          nullable: true
        published_at:
          type: string
          nullable: true
          description: When the post was published, as the network gives it.
        thumbnail:
          type: string
          nullable: true
          description: The post's cover picture.
        duration:
          type: number
          nullable: true
          description: A video post's length in seconds.
        error:
          type: boolean
          enum:
            - false
          description: >-
            Always false: a post that can't be read answers with an error status
            instead.
        medias:
          type: object
          description: >-
            The post's files by kind. Each list is `[]` when the post has none
            of that kind.
          required:
            - images
            - videos
            - audio
          properties:
            images:
              type: array
              items:
                $ref: '#/components/schemas/MediaDownloadFile'
            videos:
              type: array
              items:
                $ref: '#/components/schemas/MediaDownloadFile'
            audio:
              type: array
              items:
                $ref: '#/components/schemas/MediaDownloadFile'
        warnings:
          type: array
          description: Things to know about the answer. `[]` when there are none.
          items:
            type: object
            required:
              - code
              - message
            properties:
              code:
                type: string
                enum:
                  - no_media
                  - photos_incomplete
                  - photo_low_resolution
                  - truncated
                description: >-
                  `no_media`: the post is only text. `photos_incomplete`: only
                  some photos could be read. `photo_low_resolution`: some photos
                  are only available small. `truncated`: only the first files
                  are included.
              message:
                type: string
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: When the links stop working.
    Error:
      type: object
      description: >-
        An error answer. Every one has `message`, in plain words; some add an
        `error` code and fields of their own.
      required:
        - message
      properties:
        message:
          type: string
          description: What went wrong and what to do about it.
    MediaDownloadError:
      type: object
      title: Download error
      description: A social post that couldn't be read.
      required:
        - message
        - code
      properties:
        message:
          type: string
          description: Why, in words to show a person.
        code:
          type: string
          description: >-
            Why, as a code: `post_unavailable` (404); `invalid_url`,
            `blocked_address`, `login_required`, `geo_restricted`,
            `link_expired`, `unsupported_url`, `no_media`, `live_not_supported`,
            `file_too_large` or `platform_error` (422); `unavailable` (503).
    ValidationError:
      type: object
      description: '422: the request didn''t pass validation, and nothing changed.'
      required:
        - message
        - errors
      properties:
        message:
          type: string
          description: >-
            The first error and, when there are more, how many: `(and 1 more
            error)`, `(and 2 more errors)`.
        errors:
          type: object
          description: >-
            The messages, by field. A field inside a list is named with dots:
            `accounts.0.id`.
          additionalProperties:
            type: array
            items:
              type: string
    MediaDownloadFile:
      type: object
      description: One file of the post.
      required:
        - id
        - index
        - url
        - type
        - extension
        - mime_type
        - filename
        - quality
        - width
        - height
        - duration
        - thumbnail
        - expires_at
        - mp3_url
        - has_no_audio
      properties:
        id:
          type: string
          description: '`media_` and its place in the post, like `media_0`.'
        index:
          type: integer
          description: Its place in the post, from 0.
        url:
          type: string
          description: The file's download link. It stops working at `expires_at`.
        type:
          type: string
          enum:
            - image
            - video
            - audio
        extension:
          type: string
          nullable: true
          description: Like `jpg` or `mp4`.
        mime_type:
          type: string
          nullable: true
        filename:
          type: string
          nullable: true
        quality:
          type: string
          nullable: true
          description: >-
            What the network calls the size, like `1080p`, or `original` for a
            photo.
        width:
          type: integer
          nullable: true
        height:
          type: integer
          nullable: true
        duration:
          type: number
          nullable: true
          description: A video's or sound's length in seconds.
        thumbnail:
          type: string
          nullable: true
          description: A video's still, as a download link.
        expires_at:
          type: string
          format: date-time
          nullable: true
          description: 'When the links of this file stop working: a few hours at most.'
        mp3_url:
          type: string
          nullable: true
          description: >-
            The file's sound as an MP3 download link; null for photos and silent
            videos.
        has_no_audio:
          type: boolean
          description: Always false.
  responses:
    Unauthorized401:
      description: No API key, or not a valid one.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            unauthenticated:
              summary: No valid API key
              value:
                message: Unauthenticated.
    RateLimited429:
      description: >-
        More than 60 requests in a minute from this key's user (the API and the
        MCP server share the count). Wait `Retry-After` seconds.
      headers:
        Retry-After:
          description: Seconds until requests are allowed again.
          schema:
            type: integer
        X-RateLimit-Limit:
          description: Requests allowed a minute.
          schema:
            type: integer
        X-RateLimit-Remaining:
          description: Requests left this minute.
          schema:
            type: integer
        X-RateLimit-Reset:
          description: When requests are allowed again, as a Unix timestamp.
          schema:
            type: integer
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            too_many_attempts:
              summary: Too many requests
              value:
                message: Too Many Attempts.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````

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