# X/Twitter Tweet Counts Recent via Surplus Intelligence

> X/Twitter Tweet Counts Recent via Surplus Intelligence is a paid API for AI agents from www.surplusintelligence.ai, paid per call via x402, $0.007900/call, status unknown (last checked 2026-09-14).

Returns bucketed counts of recent tweets matching a search query over the past 7 days, using the Twitter API v2 counts endpoint.

## Facts

- Endpoint: GET https://www.surplusintelligence.ai/x402/api/twitter/v2/tweets/counts/recent
- Price: $0.007900/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-14
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/www-surplusintelligence-ai-0d9a1ee3
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_Ru5e4aeDyE3k8nXiHau52

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 www-surplusintelligence-ai-0d9a1ee3
```

Example prompt: How many tweets have mentioned 'OpenAI' in the last 7 days? Break it down by day so I can see the trend.

## When to prefer this

Use this endpoint when you need to measure tweet volume or activity trends for a keyword, hashtag, or boolean query over the past 7 days without retrieving the actual tweet content. It is more efficient and cheaper than fetching full tweet search results when you only need counts. Choose the 'all' variant if you need historical data beyond 7 days.

## Known failure modes

- Invalid or missing query parameter returns a 400-level error
- Query too complex or unsupported operators return an API error from Twitter
- Granularity value outside allowed enum returns validation error
- Payment not processed (402) if USDC balance is insufficient
- Rate limits exceeded on the underlying Twitter API return a 429-style error
- Empty result set if no tweets match the query in the recent window

## How this service works

X/Twitter API v2 via Surplus Intelligence: Tweet counts recent (1 unit)

## Output

Returns a time-series array of tweet count buckets (with start/end timestamps and count per bucket) at the requested granularity (minute, hour, or day), plus metadata such as total count and newest/oldest result IDs. Covers approximately the last 7 days of Twitter data.

## Example request

```json
{
 "input": {
  "type": "http",
  "method": "GET",
  "queryParams": {
   "query": "artificial intelligence",
   "granularity": "day"
  }
 }
}
```

## 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",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "query"
     ],
     "properties": {
      "query": {
       "type": "string",
       "description": "X/Twitter recent counts query."
      },
      "granularity": {
       "enum": [
        "minute",
        "hour",
        "day"
       ],
       "type": "string",
       "description": "Count bucket granularity."
      }
     },
     "additionalProperties": true
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "properties": {
      "data": {},
      "meta": {
       "type": "object"
      },
      "errors": {
       "type": "array"
      }
     },
     "additionalProperties": true
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "object",
 "required": [
  "data",
  "meta"
 ],
 "properties": {
  "data": {
   "type": "array",
   "items": {
    "type": "object",
    "required": [
     "end",
     "start",
     "tweet_count"
    ],
    "properties": {
     "end": {
      "type": "string"
     },
     "start": {
      "type": "string"
     },
     "tweet_count": {
      "type": "number"
     }
    }
   }
  },
  "meta": {
   "type": "object",
   "required": [
    "total_tweet_count"
   ],
   "properties": {
    "total_tweet_count": {
     "type": "number"
    }
   }
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/www-surplusintelligence-ai-0d9a1ee3/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from www.surplusintelligence.ai](https://www.zero.xyz/host/www.surplusintelligence.ai/llms.txt)
