# Twitter /tweets

## Networks

| Name | Mode | CAIP-2 | Chain ID / Cluster | Protocols |
|---|---|---|---|---|
| Tempo Mainnet | live | `eip155:4217` | 4217 | mpp |
| Solana Mainnet | live | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` | mainnet-beta | mpp, x402 |
| Base | live | `eip155:8453` | 8453 | x402 |

## Accepted Currencies

| Symbol | Name | Decimals | Network | Address | Protocols |
|---|---|---|---|---|---|
| USDC.e | Bridged USDC (Stargate) | 6 | `eip155:4217` | `0x20c000000000000000000000b9537d11c60e8b50` | mpp |
| USDC | USD Coin (Solana) | 6 | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` | `EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v` | mpp, x402 |
| USDC | USD Coin | 6 | `eip155:8453` | `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` | x402 |

## Endpoints (2)

### Twitter: Bulk Tweet Lookup (alias)

Alias of POST /tweets kept for X v2 API compatibility — performs the same bulk tweet lookup, not a delete (upstream exposes no bulk-delete). Query param: ids (comma-separated numeric tweet IDs, max 50).

- Method: DELETE
- Path: `/tweets`
- Price: $0.01400000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "ids": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Numeric ID string"
          }
        },
        {
          "type": "string"
        }
      ],
      "description": "Tweet IDs to look up: either an array of numeric ID strings or a comma-separated string. Max 50."
    }
  },
  "required": [
    "ids"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "tweets": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      },
      "description": "Array of tweet objects."
    },
    "has_next_page": {
      "type": "boolean",
      "description": "True when more pages are available."
    },
    "next_cursor": {
      "type": "string",
      "description": "Cursor to pass as `next_token` for the next page."
    }
  },
  "additionalProperties": true,
  "description": "Tweet list JSON forwarded verbatim from twitterapi.io."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://twitter.payweave.services/tweets', {
  method: 'DELETE',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      ""
    ]
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://twitter.payweave.services/tweets', {
  method: 'DELETE',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      ""
    ]
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://twitter.payweave.services/tweets" -X DELETE -H 'Content-Type: application/json' -d '{"ids":[""]}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://twitter.payweave.services/tweets" -X DELETE --json '{"ids":[""]}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://twitter.payweave.services/tweets" -X DELETE -H 'Content-Type: application/json' -d '{"ids":[""]}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://twitter.payweave.services/tweets" -m DELETE -b '{"ids":[""]}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://twitter.payweave.services/tweets', {
  method: 'DELETE',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      ""
    ]
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://twitter.payweave.services/tweets" -m DELETE -b '{"ids":[""]}' -p x402
```

### Twitter: Bulk Tweet Lookup

Bulk look up multiple Twitter/X tweets by their numeric tweet IDs in a single request (max 50). Each tweet includes full text, author profile, and engagement metrics. Body: { "ids": ["123", "456"] } or { "ids": "123,456" }.

- Method: POST
- Path: `/tweets`
- Price: $0.01400000

**Input Schema**

```json
{
  "type": "object",
  "properties": {
    "ids": {
      "anyOf": [
        {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^\\d+$",
            "description": "Numeric ID string"
          }
        },
        {
          "type": "string"
        }
      ],
      "description": "Tweet IDs to look up: either an array of numeric ID strings or a comma-separated string. Max 50."
    }
  },
  "required": [
    "ids"
  ],
  "additionalProperties": false
}
```

**Output Schema**

```json
{
  "type": "object",
  "properties": {
    "tweets": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": {}
      },
      "description": "Array of tweet objects."
    },
    "has_next_page": {
      "type": "boolean",
      "description": "True when more pages are available."
    },
    "next_cursor": {
      "type": "string",
      "description": "Cursor to pass as `next_token` for the next page."
    }
  },
  "additionalProperties": true,
  "description": "Tweet list JSON forwarded verbatim from twitterapi.io."
}
```

## How to invoke

Payment is handled automatically — the client signs the 402 challenge and retries.

### TypeScript — Tempo (mppx + fetch) ([docs](https://mpp.dev/sdk/typescript/client))

```ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({
  methods: [tempo({ account: privateKeyToAccount('0x...') })],
})

const res = await fetch('https://twitter.payweave.services/tweets', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      ""
    ]
  }),
})
const data = await res.json()
```

### TypeScript — Solana (@solana/mpp + fetch) ([docs](https://github.com/solana-foundation/mpp-sdk))

```ts
import { createKeyPairSignerFromBytes } from '@solana/kit'
import { Mppx } from 'mppx/client'
import { solana } from '@solana/mpp/client'

const signer = await createKeyPairSignerFromBytes(/* 64-byte secret key */)
Mppx.create({ methods: [solana({ signer })] })

const res = await fetch('https://twitter.payweave.services/tweets', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      ""
    ]
  }),
})
const data = await res.json()
```

### mppx CLI ([docs](https://mpp.dev/sdk/typescript/cli))

```sh
npx mppx "https://twitter.payweave.services/tweets" -X POST -H 'Content-Type: application/json' -d '{"ids":[""]}'
```

### Tempo Wallet ([docs](https://docs.tempo.xyz/cli/wallet))

```sh
tempo request "https://twitter.payweave.services/tweets" -X POST --json '{"ids":[""]}'
```

### pay.sh — Solana Foundation ([docs](https://pay.sh))

```sh
pay --mainnet curl "https://twitter.payweave.services/tweets" -X POST -H 'Content-Type: application/json' -d '{"ids":[""]}'
```

### agentcash CLI ([docs](https://www.npmjs.com/package/agentcash))

```sh
npx agentcash fetch "https://twitter.payweave.services/tweets" -m POST -b '{"ids":[""]}' -p mpp
```

### x402 — Base / Solana USDC (x402-fetch) ([docs](https://x402.org))

```ts
import { wrapFetchWithPayment } from 'x402-fetch'
import { privateKeyToAccount } from 'viem/accounts'

const account = privateKeyToAccount('0x...') // Base USDC wallet
const fetchWithPay = wrapFetchWithPayment(fetch, account)

const res = await fetchWithPay('https://twitter.payweave.services/tweets', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    "ids": [
      ""
    ]
  }),
})
const data = await res.json()
```

### x402 — agentcash CLI

```sh
npx agentcash fetch "https://twitter.payweave.services/tweets" -m POST -b '{"ids":[""]}' -p x402
```
