APICommunitySocial Media

Reddit Trending Posts

Retrieve currently trending Reddit posts across all subreddits with stable cursor pagination. Review the selected endpoint’s request fields before calling. Use it in a social research or monitoring workflow. The POST request schema also lists max_items, summary.

Selected price
$0.0003 / callPublished pricing
Sellers / APIs
1 / 1
Requests · 30d
—Loading...
Success rate · 30d
—Loading...
USE THIS API

Reddit Trending Posts

Prepare your request, then continue with your agent.

Selected price

$0.0003 / call

Provider
Pricing
Connect your agent
On this page

Playground

Run sends a real API request. Charges follow the published API contract.

Request parameters
Optional parameters (12)
Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item: each row of the API's result list, or the `data` object itself for an API that returns one record. Keys are matched relative to that item, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost.
Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. An API that returns one record is not trimmed. Does not change cost.
Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost.
Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.
Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price.
Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict.
Pagination cursor from a previous response's nextCursor. Omit for the first page.
Optional, default true. When false, only the sources listed in `source` may serve; the request is refused with no charge if none of them can. When true, the listed sources are tried first and any other source may serve after them, at the normal price.
ignoreSources array
Optional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way.
Maximum number of trending posts to return (1-100, default 25).
Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.
source array
Optional. Source ids to prefer, in order, taken from this endpoint's `lanes[].source.id` in /catalog or /apis. Omit it and the cheapest source serves, with automatic failover. Listed sources are tried first in the order given, then the others, unless `allowFallbacks` is false. A single source with `allowFallbacks` false is served only by that source at its price, quoted and charged exactly, with no failover. The price is that of the dearest source that may serve. An id that does not serve this endpoint is rejected as invalid input with no charge; a listed source that is not serving right now is refused with no charge, so omit `source` to be served by another. On a paginated walk, later pages must include the source that served page one, or omit `source`.

Sample response

{
  "output": {
    "data": {
      "nextCursor": "t3_1gm0d2",
      "posts": [
        {
          "author": "orbital_mechanic",
          "authorId": "4d8k1n",
          "createdUtc": 1717516800,
          "domain": "nasa.gov",
          "id": "1gm3k8",
          "isArchived": false,
          "isLocked": false,
          "nsfw": false,
          "numComments": 3120,
          "permalink": "/r/space/comments/1gm3k8/nasas_europa_clipper_sends_back_its_first_images/",
          "score": 84210,
          "selftext": "",
          "subreddit": "space",
          "title": "NASA's Europa Clipper sends back its first images of Jupiter's icy moon",
          "upvoteRatio": 0.98,
          "url": "https://www.nasa.gov/europa-clipper-first-images"
        },
        {
          "author": "econ_watcher",
          "authorId": "7q2m9x",
          "createdUtc": 1717513200,
          "domain": "reuters.com",
          "id": "1gm2f1",
          "isArchived": false,
          "isLocked": false,
          "nsfw": false,
          "numComments": 5896,
          "permalink": "/r/technology/comments/1gm2f1/study_finds_four_day_work_week_trial_improved/",
          "score": 41720,
          "selftext": "",
          "subreddit": "technology",
          "title": "Study finds four day work week trial improved productivity at 92% of companies",
          "upvoteRatio": 0.95,
          "url": "https://www.reuters.com/business/four-day-week-trial-results"
        },
        {
          "author": "trailrunner_kate",
          "authorId": "3f5j7p",
          "createdUtc": 1717509600,
          "domain": "self.gaming",
          "id": "1gm1a4",
          "isArchived": false,
          "isLocked": false,
          "nsfw": false,
          "numComments": 1042,
          "permalink": "/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/",
          "score": 26330,
          "selftext": "After three years of nights and weekends we finally launched Wraithmoor Keep on Steam. It is built entirely in Godot 4 and the whole team is six people. Happy to answer questions about the pipeline.",
          "subreddit": "gaming",
          "title": "Indie studio's 6 person team ships a 40 hour RPG built entirely in Godot",
          "upvoteRatio": 0.99,
          "url": "https://www.reddit.com/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/"
        }
      ]
    },
    "found": true
  }
}

Response result

Response structure

Inferred from examples
  • outputobject
    • dataobject
      • nextCursorstring
      • postsobject[]
        • authorstring
        • authorIdstring
        • createdUtcinteger
        • domainstring
        • idstring
        • isArchivedboolean
        • isLockedboolean
        • nsfwboolean
        • numCommentsinteger
        • permalinkstring
        • scoreinteger
        • selftextstring
        • subredditstring
        • titlestring
        • upvoteRationumber
        • urlstring
    • foundboolean

Sellers

SellerPricingRequests · 30dPerformanceAccess
anyapiCurrent
Reddit Trending Posts · POST · View API reference
$0.0003 / call—
—successP50—
Loading...
Selected pricing · anyapiUSD / call
Unit price
$0.0003

Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 4. Price update time: not supplied.

calls

Total $0.03

API

Method
POST
Endpoint
https://api.openany.si/v1/agent-apis/anyapi/v1/run/reddit.trending_posts
Content type
application/json
Authentication
Authorization: Bearer $OPENANY_API_KEY
curl \
  'https://api.openany.si/v1/agent-apis/anyapi/v1/run/reddit.trending_posts' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{}'

Input parameters

Fields in this listing; additional options and input encoding can vary by provider.

ParameterLocationTypeRequiredDescription
fieldsURL query parametersquerystringNoOptional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item: each row of the API's result list, or the `data` object itself for an API that returns one record. Keys are matched relative to that item, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost.
max_itemsURL query parametersqueryintegerNoOptional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. An API that returns one record is not trimmed. Does not change cost.

minimum: 0

summaryURL query parametersquerybooleanNoOptional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost.
jqURL query parametersquerystringNoOptional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.
max_cost_usdURL query parametersquerystringNoOptional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price.
Idempotency-KeyRequest headersheadersstringNoOptional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict.

minLength: 1 · maxLength: 255

afterJSON request bodybodystringNoPagination cursor from a previous response's nextCursor. Omit for the first page.

minLength: 1

allowFallbacksJSON request bodybodybooleanNoOptional, default true. When false, only the sources listed in `source` may serve; the request is refused with no charge if none of them can. When true, the listed sources are tried first and any other source may serve after them, at the normal price.
ignoreSourcesJSON request bodybodyarrayNoOptional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way.
Nested fields and variants

body.ignoreSources[] · Array item · string

limitJSON request bodybodyintegerNoMaximum number of trending posts to return (1-100, default 25).

minimum: 1 · maximum: 100

preferLatencyUnderMsJSON request bodybodyintegerNoOptional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.

minimum: 1

sourceJSON request bodybodyarrayNoOptional. Source ids to prefer, in order, taken from this endpoint's `lanes[].source.id` in /catalog or /apis. Omit it and the cheapest source serves, with automatic failover. Listed sources are tried first in the order given, then the others, unless `allowFallbacks` is false. A single source with `allowFallbacks` false is served only by that source at its price, quoted and charged exactly, with no failover. The price is that of the dearest source that may serve. An id that does not serve this endpoint is rejected as invalid input with no charge; a listed source that is not serving right now is refused with no charge, so omit `source` to be served by another. On a paginated walk, later pages must include the source that served page one, or omit `source`.
Nested fields and variants

body.source[] · Array item · string

Required markers inside a nested object or variant apply when that object or variant is used.

Sample response

Sample response · Configured HTTP 200; actual status is unverified. Example from the provider's documentation. Field values in your results will differ.

Official example (output fragment; HTTP assumed)
{
  "output": {
    "data": {
      "nextCursor": "t3_1gm0d2",
      "posts": [
        {
          "author": "orbital_mechanic",
          "authorId": "4d8k1n",
          "createdUtc": 1717516800,
          "domain": "nasa.gov",
          "id": "1gm3k8",
          "isArchived": false,
          "isLocked": false,
          "nsfw": false,
          "numComments": 3120,
          "permalink": "/r/space/comments/1gm3k8/nasas_europa_clipper_sends_back_its_first_images/",
          "score": 84210,
          "selftext": "",
          "subreddit": "space",
          "title": "NASA's Europa Clipper sends back its first images of Jupiter's icy moon",
          "upvoteRatio": 0.98,
          "url": "https://www.nasa.gov/europa-clipper-first-images"
        },
        {
          "author": "econ_watcher",
          "authorId": "7q2m9x",
          "createdUtc": 1717513200,
          "domain": "reuters.com",
          "id": "1gm2f1",
          "isArchived": false,
          "isLocked": false,
          "nsfw": false,
          "numComments": 5896,
          "permalink": "/r/technology/comments/1gm2f1/study_finds_four_day_work_week_trial_improved/",
          "score": 41720,
          "selftext": "",
          "subreddit": "technology",
          "title": "Study finds four day work week trial improved productivity at 92% of companies",
          "upvoteRatio": 0.95,
          "url": "https://www.reuters.com/business/four-day-week-trial-results"
        },
        {
          "author": "trailrunner_kate",
          "authorId": "3f5j7p",
          "createdUtc": 1717509600,
          "domain": "self.gaming",
          "id": "1gm1a4",
          "isArchived": false,
          "isLocked": false,
          "nsfw": false,
          "numComments": 1042,
          "permalink": "/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/",
          "score": 26330,
          "selftext": "After three years of nights and weekends we finally launched Wraithmoor Keep on Steam. It is built entirely in Godot 4 and the whole team is six people. Happy to answer questions about the pipeline.",
          "subreddit": "gaming",
          "title": "Indie studio's 6 person team ships a 40 hour RPG built entirely in Godot",
          "upvoteRatio": 0.99,
          "url": "https://www.reddit.com/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/"
        }
      ]
    },
    "found": true
  }
}

Agent integration

Copy the resource contract without sharing an API key.

View API Markdown
API Markdown
# Reddit Trending Posts

Retrieve currently trending Reddit posts across all subreddits with stable cursor pagination. Review the selected endpoint’s request fields before calling. Use it in a social research or monitoring workflow. The POST request schema also lists max_items, summary.
## Available implementations
anyapi · Reddit Trending Posts: https://openany.si/markets/apis/capabilities/reddit-trending-posts?offering=eb805df9-5248-46b1-ba75-286c1303fea3 · $0.0003 / call

## Selected API contract
Documentation: https://openany.si/markets/apis/capabilities/reddit-trending-posts
Method: POST
Endpoint: https://api.openany.si/v1/agent-apis/anyapi/v1/run/reddit.trending_posts
Price: $0.0003 / call
Provider: anyapi
Contract revision: 4
Price source: OpenAny public API contract and documented provider unit rates. Price update time: not supplied.

Use OPENANY_API_KEY from the environment. API Key calls use your shared balance.

## Prepared request
```bash
curl \
  'https://api.openany.si/v1/agent-apis/anyapi/v1/run/reddit.trending_posts' \
  -X POST \
  -H "Authorization: Bearer $OPENANY_API_KEY" \
  -H 'Content-Type: application/json' \
  --data-raw '{}'
```

## API contract
```json
{
  "resource_type": "api",
  "name": "Reddit Trending Posts",
  "endpoint": "https://api.openany.si/v1/agent-apis/anyapi/v1/run/reddit.trending_posts",
  "method": "POST",
  "content_type": "application/json",
  "execution_mode": "sync",
  "authentication": {
    "type": "bearer",
    "environment_variable": "OPENANY_API_KEY"
  },
  "inputs": [
    {
      "description": "Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item: each row of the API's result list, or the `data` object itself for an API that returns one record. Keys are matched relative to that item, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost.",
      "location": "query",
      "name": "fields",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. An API that returns one record is not trimmed. Does not change cost.",
      "location": "query",
      "minimum": "0",
      "name": "max_items",
      "nullable": false,
      "required": false,
      "type": "integer"
    },
    {
      "description": "Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost.",
      "location": "query",
      "name": "summary",
      "nullable": false,
      "required": false,
      "type": "boolean"
    },
    {
      "description": "Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.",
      "location": "query",
      "name": "jq",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price.",
      "location": "query",
      "name": "max_cost_usd",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict.",
      "location": "header",
      "max_length": 255,
      "min_length": 1,
      "name": "Idempotency-Key",
      "nullable": false,
      "required": false,
      "type": "string"
    },
    {
      "description": "Pagination cursor from a previous response's nextCursor. Omit for the first page.",
      "location": "body",
      "min_length": 1,
      "name": "after",
      "nullable": false,
      "pointer": "/after",
      "required": false,
      "type": "string"
    },
    {
      "description": "Optional, default true. When false, only the sources listed in `source` may serve; the request is refused with no charge if none of them can. When true, the listed sources are tried first and any other source may serve after them, at the normal price.",
      "location": "body",
      "name": "allowFallbacks",
      "nullable": false,
      "pointer": "/allowFallbacks",
      "required": false,
      "type": "boolean"
    },
    {
      "description": "Optional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way.",
      "item_type": "string",
      "location": "body",
      "name": "ignoreSources",
      "nullable": false,
      "pointer": "/ignoreSources",
      "required": false,
      "type": "array"
    },
    {
      "description": "Maximum number of trending posts to return (1-100, default 25).",
      "location": "body",
      "maximum": "100",
      "minimum": "1",
      "name": "limit",
      "nullable": false,
      "pointer": "/limit",
      "required": false,
      "type": "integer"
    },
    {
      "description": "Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.",
      "location": "body",
      "minimum": "1",
      "name": "preferLatencyUnderMs",
      "nullable": false,
      "pointer": "/preferLatencyUnderMs",
      "required": false,
      "type": "integer"
    },
    {
      "description": "Optional. Source ids to prefer, in order, taken from this endpoint's `lanes[].source.id` in /catalog or /apis. Omit it and the cheapest source serves, with automatic failover. Listed sources are tried first in the order given, then the others, unless `allowFallbacks` is false. A single source with `allowFallbacks` false is served only by that source at its price, quoted and charged exactly, with no failover. The price is that of the dearest source that may serve. An id that does not serve this endpoint is rejected as invalid input with no charge; a listed source that is not serving right now is refused with no charge, so omit `source` to be served by another. On a paginated walk, later pages must include the source that served page one, or omit `source`.",
      "item_type": "string",
      "location": "body",
      "name": "source",
      "nullable": false,
      "pointer": "/source",
      "required": false,
      "type": "array"
    }
  ],
  "billing": {
    "currency": "USD",
    "mode": "fixed",
    "priceMicroUsd": "300",
    "rounding": null,
    "unit": "call",
    "unitQuantity": null
  },
  "examples": [
    {
      "http_status": 200,
      "name": "Official example (output fragment; HTTP assumed)",
      "request": {
        "body": {},
        "headers": {},
        "path": {},
        "query": {}
      },
      "response_body": {
        "output": {
          "data": {
            "nextCursor": "t3_1gm0d2",
            "posts": [
              {
                "author": "orbital_mechanic",
                "authorId": "4d8k1n",
                "createdUtc": 1717516800,
                "domain": "nasa.gov",
                "id": "1gm3k8",
                "isArchived": false,
                "isLocked": false,
                "nsfw": false,
                "numComments": 3120,
                "permalink": "/r/space/comments/1gm3k8/nasas_europa_clipper_sends_back_its_first_images/",
                "score": 84210,
                "selftext": "",
                "subreddit": "space",
                "title": "NASA's Europa Clipper sends back its first images of Jupiter's icy moon",
                "upvoteRatio": 0.98,
                "url": "https://www.nasa.gov/europa-clipper-first-images"
              },
              {
                "author": "econ_watcher",
                "authorId": "7q2m9x",
                "createdUtc": 1717513200,
                "domain": "reuters.com",
                "id": "1gm2f1",
                "isArchived": false,
                "isLocked": false,
                "nsfw": false,
                "numComments": 5896,
                "permalink": "/r/technology/comments/1gm2f1/study_finds_four_day_work_week_trial_improved/",
                "score": 41720,
                "selftext": "",
                "subreddit": "technology",
                "title": "Study finds four day work week trial improved productivity at 92% of companies",
                "upvoteRatio": 0.95,
                "url": "https://www.reuters.com/business/four-day-week-trial-results"
              },
              {
                "author": "trailrunner_kate",
                "authorId": "3f5j7p",
                "createdUtc": 1717509600,
                "domain": "self.gaming",
                "id": "1gm1a4",
                "isArchived": false,
                "isLocked": false,
                "nsfw": false,
                "numComments": 1042,
                "permalink": "/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/",
                "score": 26330,
                "selftext": "After three years of nights and weekends we finally launched Wraithmoor Keep on Steam. It is built entirely in Godot 4 and the whole team is six people. Happy to answer questions about the pipeline.",
                "subreddit": "gaming",
                "title": "Indie studio's 6 person team ships a 40 hour RPG built entirely in Godot",
                "upvoteRatio": 0.99,
                "url": "https://www.reddit.com/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/"
              }
            ]
          },
          "found": true
        }
      }
    }
  ]
}
```

Error handling

StatusNext step
400Check the offering and request fields.
401 / 403Verify your credentials and access permissions.
402Inspect the selected access mode and returned payment requirements.
429Respect the returned rate limit and retry guidance.
5xxInspect the error and usage record before retrying a paid operation.

Examples

Official example (output fragment; HTTP assumed)

Example from the provider's documentation. Field values in your results will differ.

  1. Prepare your environment

    Use a terminal with cURL installed.

    Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.

    Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.

    Terminal · macOS / Linux
    printf 'OpenAny API key: '
    read -r -s OPENANY_API_KEY
    export OPENANY_API_KEY
    printf '\n'
  2. Run the request

    Paste the complete command below into your terminal.

    Values to replace before running 12

    Review these request fields before running. Keep the published provider and request method unchanged.

    fields
    Optional. Comma-separated keys (dotted paths like `author.name` descend into nested objects) to keep on each result item: each row of the API's result list, or the `data` object itself for an API that returns one record. Keys are matched relative to that item, not against the top-level response envelope, so use `jq` to reshape the whole envelope. Shrinks the response without changing cost.
    max_items
    Optional. Cap the number of result rows returned; a `_truncated` note reports how many were withheld so you can page via the API's own `limit`. An API that returns one record is not trimmed. Does not change cost.
    summary
    Optional. Return only a structural outline (top-level keys, item counts, and per-field byte sizes) instead of the full data. Does not change cost.
    jq
    Optional. A jq expression applied to the result envelope; its output replaces `output` (multiple outputs collect into an array). Reshape freely, e.g. `jq=.data | {title, description, md: .markdown[:3500]}`. Runs sandboxed with a 250ms / 2MB budget; on failure the full result is returned with a `jqError`. Does not change cost.
    max_cost_usd
    Optional. The most you are willing to pay for this one request, in US dollars (for example 0.05). Any route that would charge more than this is not used, so a request only ever runs on something you can afford. If nothing is available at or below your amount, the request is refused before it runs, nothing is charged, and the message tells you the cheapest price per request so you can raise it. Leave it out to accept the normal price.
    Idempotency-Key
    Optional wallet idempotency key, scoped to this customer for 24 hours. When the gateway honors the key, this synchronous in-process execution can continue after the caller disconnects, bounded by its execution deadline. A completed replayable result charges normally exactly once and can be replayed without another provider run or charge. A pending duplicate returns 409 idempotency_in_progress; reuse with different request semantics returns 409 idempotency_conflict.
    after
    Pagination cursor from a previous response's nextCursor. Omit for the first page.
    allowFallbacks
    Optional, default true. When false, only the sources listed in `source` may serve; the request is refused with no charge if none of them can. When true, the listed sources are tried first and any other source may serve after them, at the normal price.
    ignoreSources
    Optional. Source ids to skip for this request, taken from this endpoint's `lanes[].source.id`. The cheapest remaining source serves and the price is that of the dearest remaining source. An id that does not serve this endpoint, or that is also in `source`, is rejected as invalid input with no charge; skipping every source is rejected the same way.
    limit
    Maximum number of trending posts to return (1-100, default 25).
    preferLatencyUnderMs
    Optional; omit it and routing is unchanged, with the cheapest source serving. Prefer sources whose typical response time (median over the trailing 30 days, as published on this endpoint's lane health) is under this many milliseconds; among those, the cheapest serves. This can raise your price: when the cheapest source misses the target, a faster and dearer one serves, and you are quoted and charged its price. If no source is that fast the request is still served, by whichever source offers the best speed for its price - it is never refused for being slow. Sources we have not timed are tried last. This is a preference, not a guarantee: the median describes past requests and is not a ceiling on this one, and it excludes any wait this request itself asks for. On a paginated walk it applies to the first page only: later pages stay with the source that page chose, at the price it was quoted.
    source
    Optional. Source ids to prefer, in order, taken from this endpoint's `lanes[].source.id` in /catalog or /apis. Omit it and the cheapest source serves, with automatic failover. Listed sources are tried first in the order given, then the others, unless `allowFallbacks` is false. A single source with `allowFallbacks` false is served only by that source at its price, quoted and charged exactly, with no failover. The price is that of the dearest source that may serve. An id that does not serve this endpoint is rejected as invalid input with no charge; a listed source that is not serving right now is refused with no charge, so omit `source` to be served by another. On a paginated walk, later pages must include the source that served page one, or omit `source`.
    Terminal · cURL
    curl \
      'https://api.openany.si/v1/agent-apis/anyapi/v1/run/reddit.trending_posts' \
      -X POST \
      -H "Authorization: Bearer $OPENANY_API_KEY" \
      -H 'Content-Type: application/json' \
      --data-raw '{}'
  3. Check the response

    Sample response · Configured HTTP 200; actual status is unverified.

    Sample response
    {
      "output": {
        "data": {
          "nextCursor": "t3_1gm0d2",
          "posts": [
            {
              "author": "orbital_mechanic",
              "authorId": "4d8k1n",
              "createdUtc": 1717516800,
              "domain": "nasa.gov",
              "id": "1gm3k8",
              "isArchived": false,
              "isLocked": false,
              "nsfw": false,
              "numComments": 3120,
              "permalink": "/r/space/comments/1gm3k8/nasas_europa_clipper_sends_back_its_first_images/",
              "score": 84210,
              "selftext": "",
              "subreddit": "space",
              "title": "NASA's Europa Clipper sends back its first images of Jupiter's icy moon",
              "upvoteRatio": 0.98,
              "url": "https://www.nasa.gov/europa-clipper-first-images"
            },
            {
              "author": "econ_watcher",
              "authorId": "7q2m9x",
              "createdUtc": 1717513200,
              "domain": "reuters.com",
              "id": "1gm2f1",
              "isArchived": false,
              "isLocked": false,
              "nsfw": false,
              "numComments": 5896,
              "permalink": "/r/technology/comments/1gm2f1/study_finds_four_day_work_week_trial_improved/",
              "score": 41720,
              "selftext": "",
              "subreddit": "technology",
              "title": "Study finds four day work week trial improved productivity at 92% of companies",
              "upvoteRatio": 0.95,
              "url": "https://www.reuters.com/business/four-day-week-trial-results"
            },
            {
              "author": "trailrunner_kate",
              "authorId": "3f5j7p",
              "createdUtc": 1717509600,
              "domain": "self.gaming",
              "id": "1gm1a4",
              "isArchived": false,
              "isLocked": false,
              "nsfw": false,
              "numComments": 1042,
              "permalink": "/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/",
              "score": 26330,
              "selftext": "After three years of nights and weekends we finally launched Wraithmoor Keep on Steam. It is built entirely in Godot 4 and the whole team is six people. Happy to answer questions about the pipeline.",
              "subreddit": "gaming",
              "title": "Indie studio's 6 person team ships a 40 hour RPG built entirely in Godot",
              "upvoteRatio": 0.99,
              "url": "https://www.reddit.com/r/gaming/comments/1gm1a4/indie_studios_6_person_team_ships_a_40_hour_rpg/"
            }
          ]
        },
        "found": true
      }
    }

Common questions

Do I need a separate key for every provider?

Use your OpenAny API key for standard API access. Read it from OPENANY_API_KEY in your environment and keep it out of prompts, source code and logs.

Are these providers interchangeable?

No. Each offering has its own inputs, pricing and response contract. Selecting a catalog offering does not establish automatic routing or fallback. Confirm the service contract before calling.

How is this API billed?

API-key calls use your shared balance at the selected implementation's published rate. Check the billing unit and request-specific pricing rules before making a paid call. Recorded usage determines the final charge under that contract.

Where do the price and contract come from?

The selected implementation publishes its provider, request contract, revision and billing rules through OpenAny's public API catalog. A revision number identifies a contract version, not a price update date. A price update timestamp is not supplied; do not treat a page date as one.

How do OpenAny Balance and x402 differ?

OpenAny Balance uses an API key and one shared balance. Card, USDC and x402 top-ups, card auto top-up and USDC subscriptions fund that balance; available routes appear on the Credits page. Direct x402 is a separate pay-per-request flow, available only on listings that show it and requiring an authorized payment client.

Does Playground send a paid request?

Yes. After you sign in, Run sends a real API request using an active OpenAny API key. Charges follow the published API contract and use your shared balance. Selecting an implementation, editing inputs and viewing sample responses do not send requests.

Use Reddit Trending Posts with your agent

Inspect endpoint contracts and confirm availability and pricing before a paid call.