NASA · Arazzo Workflow

NASA Media Asset Retrieval

Version 1.0.0

Search the NASA Image and Video Library, then resolve the downloadable files, metadata, and captions for a match.

1 workflow 4 source APIs 1 provider
View Spec View on GitHub GovernmentScienceSpaceArazzoWorkflows

Provider

nasa

Workflows

media-asset-retrieval
Resolve a searchable NASA media item into its files, metadata, and captions.
Searches the NASA Image and Video Library for a term, resolves the first match into its asset manifest and metadata location, and fetches captions when the match is a video.
4 steps inputs: center, mediaType, query, yearEnd, yearStart outputs: captionsLocation, mediaType, metadataLocation, nasaId, primaryAssetHref, title, totalHits
1
searchArchive
Search the NASA Image and Video Library. The response carries collection items whose data blocks hold the nasa_id needed by every later step, plus a total_hits count used to decide whether there is anything to resolve.
2
resolveAssetManifest
Resolve the nasa_id from the search hit into its asset manifest. The manifest lists an href for every rendition NASA holds for that media item (thumbnail, small, medium, original), which is what a client actually downloads.
3
resolveMetadata
Fetch the metadata location for the same nasa_id. NASA returns a signed URL pointing at the full metadata document rather than the metadata itself, so the caller follows the returned location.
4
resolveCaptions
Video assets carry a separate captions file. Resolve its location so the caller can attach captions alongside the downloaded video rendition.

Source API Descriptions

Arazzo Workflow Specification

Raw ↑
arazzo: 1.0.1
info:
  title: NASA Media Asset Retrieval
  summary: Search the NASA Image and Video Library, then resolve the downloadable files, metadata, and captions for a match.
  description: >-
    The canonical NASA Image and Video Library integration pattern. A search
    returns lightweight collection items carrying a nasa_id, but never the
    actual media files. This workflow searches the archive, takes the nasa_id
    off the first match, resolves the asset manifest that lists every rendition
    of that media, pulls the metadata location, and then branches: video assets
    additionally resolve their captions file, while images end the flow. Every
    step spells out its request inline so the flow can be read and executed
    without opening the underlying OpenAPI description.
  version: 1.0.0
sourceDescriptions:
- name: assetApi
  url: ../openapi/nasa-asset-api-openapi.yml
  type: openapi
- name: captionsApi
  url: ../openapi/nasa-captions-api-openapi.yml
  type: openapi
- name: metadataApi
  url: ../openapi/nasa-metadata-api-openapi.yml
  type: openapi
- name: searchApi
  url: ../openapi/nasa-search-api-openapi.yml
  type: openapi
workflows:
- workflowId: media-asset-retrieval
  summary: Resolve a searchable NASA media item into its files, metadata, and captions.
  description: >-
    Searches the NASA Image and Video Library for a term, resolves the first
    match into its asset manifest and metadata location, and fetches captions
    when the match is a video.
  inputs:
    type: object
    required:
    - query
    properties:
      query:
        type: string
        description: Free text search terms (e.g. "apollo 11 landing").
      mediaType:
        type: string
        description: Restrict the search to one media type.
        enum:
        - image
        - video
        - audio
      center:
        type: string
        description: Optional NASA center that published the media (e.g. "JPL").
      yearStart:
        type: string
        description: Optional earliest year to include in the search.
      yearEnd:
        type: string
        description: Optional latest year to include in the search.
  steps:
  - stepId: searchArchive
    description: >-
      Search the NASA Image and Video Library. The response carries collection
      items whose data blocks hold the nasa_id needed by every later step, plus
      a total_hits count used to decide whether there is anything to resolve.
    operationId: searchMedia
    parameters:
    - name: q
      in: query
      value: $inputs.query
    - name: media_type
      in: query
      value: $inputs.mediaType
    - name: center
      in: query
      value: $inputs.center
    - name: year_start
      in: query
      value: $inputs.yearStart
    - name: year_end
      in: query
      value: $inputs.yearEnd
    - name: page
      in: query
      value: 1
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      nasaId: $response.body#/collection/items/0/data/0/nasa_id
      title: $response.body#/collection/items/0/data/0/title
      mediaType: $response.body#/collection/items/0/data/0/media_type
      dateCreated: $response.body#/collection/items/0/data/0/date_created
      totalHits: $response.body#/collection/metadata/total_hits
    onSuccess:
    - name: noMatches
      type: end
      criteria:
      - context: $response.body
        condition: $.collection.metadata.total_hits == 0
        type: jsonpath
    - name: haveMatch
      type: goto
      stepId: resolveAssetManifest
      criteria:
      - context: $response.body
        condition: $.collection.metadata.total_hits > 0
        type: jsonpath
  - stepId: resolveAssetManifest
    description: >-
      Resolve the nasa_id from the search hit into its asset manifest. The
      manifest lists an href for every rendition NASA holds for that media item
      (thumbnail, small, medium, original), which is what a client actually
      downloads.
    operationId: getAsset
    parameters:
    - name: nasa_id
      in: path
      value: $steps.searchArchive.outputs.nasaId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      primaryAssetHref: $response.body#/collection/items/0/href
      assetItems: $response.body#/collection/items
  - stepId: resolveMetadata
    description: >-
      Fetch the metadata location for the same nasa_id. NASA returns a signed
      URL pointing at the full metadata document rather than the metadata
      itself, so the caller follows the returned location.
    operationId: getMetadata
    parameters:
    - name: nasa_id
      in: path
      value: $steps.searchArchive.outputs.nasaId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      metadataLocation: $response.body#/location
    onSuccess:
    - name: videoNeedsCaptions
      type: goto
      stepId: resolveCaptions
      criteria:
      - condition: $steps.searchArchive.outputs.mediaType == 'video'
    - name: notAVideo
      type: end
      criteria:
      - condition: $steps.searchArchive.outputs.mediaType != 'video'
  - stepId: resolveCaptions
    description: >-
      Video assets carry a separate captions file. Resolve its location so the
      caller can attach captions alongside the downloaded video rendition.
    operationId: getCaptions
    parameters:
    - name: nasa_id
      in: path
      value: $steps.searchArchive.outputs.nasaId
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      captionsLocation: $response.body#/location
  outputs:
    nasaId: $steps.searchArchive.outputs.nasaId
    title: $steps.searchArchive.outputs.title
    mediaType: $steps.searchArchive.outputs.mediaType
    totalHits: $steps.searchArchive.outputs.totalHits
    primaryAssetHref: $steps.resolveAssetManifest.outputs.primaryAssetHref
    metadataLocation: $steps.resolveMetadata.outputs.metadataLocation
    captionsLocation: $steps.resolveCaptions.outputs.captionsLocation

Work with this as data

Every workflow here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for arazzo workflows

4 MCP tools reach this
  • find_arazzoBrowse and filter every workflow in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This workflow
curl "https://apis.io/api/v1/arazzo/nasa-media-asset-retrieval-workflow"
All arazzo workflows
curl "https://apis.io/api/v1/arazzo?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.