# NASA Media Library Collection Stats

> NASA Media Library Collection Stats is a paid API for AI agents from nasa-media.x402tookit.com, paid per call via x402, $0.05/call, status unknown (last checked 2026-11-02).

Count NASA media library items matching a query, broken down by year or by NASA center, using total hit counts from the NASA Image and Video Library API.

## Facts

- Endpoint: GET https://nasa-media.x402tookit.com/nasa-collection-stats?utm_source=zero.xyz
- Price: $0.05/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-02
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nasa-media-library-collection-stats-45c2df87
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap__4TqkKdlDo0Q7YJO7PF7I

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability nasa-media-library-collection-stats-45c2df87
```

Example prompt: How many NASA images and videos exist for 'space shuttle', broken down by year from 1970 to 2011?

## When to prefer this

Use this endpoint when you need aggregate statistics or trend analysis over NASA's media library — specifically hit counts grouped by year or center — rather than fetching actual media items or metadata. Prefer this over the search endpoint when the goal is counting, comparing volumes, or identifying peak periods of coverage for a topic.

## Known failure modes

- Missing required 'q' parameter returns an error
- Query exceeding 100 characters may be rejected
- Invalid media_type value (not image/video/audio) causes an error
- year_end more than 15 years after year_start may be rejected
- group_by value other than 'year' or 'center' causes an error
- NASA upstream API downtime may result in degraded or null bucket data

## How this service works

Count NASA library items matching a query, broken down by year or by center, using the API's total hit counts.

## Output

Returns total hit count, bucketed counts (by year or center), share percentages per bucket, the peak bucket (label + hits), a plain-language summary, the original query, media type filter applied, data source URL, and optional degraded/disclaimer flags.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "q"
     ],
     "properties": {
      "q": {
       "type": "string",
       "description": "Search words, up to 100 characters"
      },
      "group_by": {
       "type": "string",
       "description": "year (default) or center"
      },
      "year_end": {
       "type": "integer",
       "description": "group_by=year: last year, up to 15 years after year_start (default: current year)"
      },
      "media_type": {
       "type": "string",
       "description": "image, video or audio (comma-separate for several); default all"
      },
      "year_start": {
       "type": "integer",
       "description": "group_by=year: first year, 1900 to 2100 (default: 9 years before year_end)"
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "asOf": {
       "type": [
        "null",
        "string"
       ]
      },
      "peak": {
       "type": [
        "null",
        "object"
       ],
       "properties": {
        "hits": {
         "type": [
          "null",
          "number"
         ]
        },
        "label": {
         "type": [
          "null",
          "string"
         ]
        }
       }
      },
      "query": {
       "type": [
        "null",
        "string"
       ]
      },
      "source": {
       "type": [
        "null",
        "string"
       ]
      },
      "buckets": {
       "type": [
        "array",
        "null"
       ],
       "items": {
        "type": "object",
        "properties": {
         "hits": {
          "type": [
           "null",
           "number"
          ]
         },
         "year": {
          "type": [
           "null",
           "string"
          ]
         },
         "share": {
          "type": [
           "null",
           "number"
          ]
         }
        }
       }
      },
      "groupBy": {
       "type": [
        "null",
        "st
… (truncated)
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nasa-media-library-collection-stats-45c2df87/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from nasa-media.x402tookit.com](https://www.zero.xyz/host/nasa-media.x402tookit.com/llms.txt)
