# getPostById

**Identifier:** `x_getPostById`

**Provider:** [X (formerly Twitter)](https://kirha.com/providers/x.md)

Get a single X post by its ID.

## Run it with the CLI

```bash
kirha tools run x_getPostById \
  --input '{
    "postId": "<postId>"
  }'
```

`--input` takes a JSON object that matches the input schema. Pass `--input -` to read it from stdin.

## Call it over HTTP

```bash
curl https://api.kirha.com/tools/v1/execute \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: **********' \
  --data '{
  "tool_name": "x_getPostById",
  "input": {
    "postId": "<postId>"
  }
}'
```

Replace the stars with an API key from https://app.kirha.com/api-keys.

## Input schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "properties": {
    "postId": {
      "type": "string"
    }
  },
  "required": [
    "postId"
  ],
  "type": "object"
}
```

## Output schema

```json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "authorId": {
      "description": "Use with getUserPosts",
      "type": "string"
    },
    "authorIsVerified": {
      "type": "boolean"
    },
    "authorName": {
      "type": "string"
    },
    "authorUsername": {
      "type": "string"
    },
    "bookmarks": {
      "type": "number"
    },
    "context": {
      "type": "string"
    },
    "conversationId": {
      "type": "string"
    },
    "createdAt": {
      "type": "string"
    },
    "hashtags": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "id": {
      "type": "string"
    },
    "impressions": {
      "type": "number"
    },
    "inReplyToUserId": {
      "type": "string"
    },
    "lang": {
      "type": "string"
    },
    "likes": {
      "type": "number"
    },
    "mentions": {
      "items": {
        "type": "string"
      },
      "type": "array"
    },
    "quotedPostId": {
      "type": "string"
    },
    "quotes": {
      "type": "number"
    },
    "repliedToPostId": {
      "type": "string"
    },
    "replies": {
      "type": "number"
    },
    "reposts": {
      "type": "number"
    },
    "retweetedPostId": {
      "type": "string"
    },
    "text": {
      "type": "string"
    },
    "url": {
      "type": "string"
    },
    "urls": {
      "items": {
        "type": "string"
      },
      "type": "array"
    }
  },
  "required": [
    "context",
    "id",
    "text",
    "likes",
    "reposts",
    "replies",
    "impressions",
    "bookmarks",
    "quotes",
    "hashtags",
    "mentions",
    "urls"
  ],
  "type": "object"
}
```

## Related tools

Other X (formerly Twitter) tools that this tool refers to, or that refer to it.

- [`getUserPosts`](https://kirha.com/providers/x/getUserPosts.md)
- [`getUserByUsername`](https://kirha.com/providers/x/getUserByUsername.md)

-----

[All X (formerly Twitter) tools](https://kirha.com/providers/x.md) · [< Back to tools list](https://kirha.com/tools.md)