---
title: "Fetch a tweet with thread context, or a user profile"
method: POST
path: "/api/v1/twitter/get"
tags: ["Twitter"]
---

# Fetch a tweet with thread context, or a user profile

`POST /api/v1/twitter/get`

## Request

- Base URL: `https://glim.sh`
- URL: `https://glim.sh/api/v1/twitter/get`
- Auth: one of:
  - none
  - API key in header `x-api-key`
  - HTTP bearer
  - API key in query parameter `apiKey`

Fetch a tweet or a user from a single reference. Tweet URLs, handle-less /i/status URLs, and bare numeric tweet ids return the tweet with full thread context, parent, and optional replies/quotes; a profile URL (https://x.com/<handle>) returns the user with ~20 recent tweets.

## Request body

- object
  - `ref` string, required: Tweet URL/id or profile URL. Tweet URLs including /i/status/<id> and bare numeric tweet ids return the tweet + thread; a profile URL (https://x.com/<handle>) returns the user + recent tweets.
  - `include` string[]: Tweet refs only: extra sections to include (replies, quotes)
  - `include_replies` boolean: Profile refs only: include replies in the timeline
  - `include_mentions` boolean: Profile refs only: include the mentions timeline
  - `cursor` string: Profile refs only: pagination cursor
  - `expand_urls` boolean: When true, auto-crawl entity URLs and attach crawled_content to tweets. Off by default: responses can grow by up to 4KB per expanded URL. Use glim_web_crawl(url) for targeted crawls instead.

## Response `200`

Tweet or user payload

- object
  - `tweet` object
  - `thread` object[]
  - `thread_has_more` boolean
  - `thread_next_cursor` string
  - `parent` object
  - `article` object
  - `replies` object
    - `tweets` object[], required
    - `count` integer, required
    - `has_more` boolean, required
    - `next_cursor` string
  - `quotes` object
    - `tweets` object[], required
    - `count` integer, required
    - `has_more` boolean, required
    - `next_cursor` string
  - `user` object
  - `tweets` object[]
  - `has_more` boolean
  - `next_cursor` string
  - `mentions` object[]

## Other responses

- `400`: Bad Request
- `402`: Payment Required
- `404`: Not Found
- `502`: Upstream Error

---

[API](https://skmtc.dev/glim/apis/glim-sh.md) · [All operations](https://skmtc.dev/glim/apis/glim-sh/llms.txt) · [OpenAPI document](https://skmtc.dev/glim/apis/glim-sh/revisions/0094e5226d73?raw)
