---
title: "TypeScript SDK"
description: "Tweet arama, takipçi dışa aktarma, DM, medya tweet'leri ve Node.js X API otomasyonu için TwexAPI TypeScript SDK kullanın."
---

Node.js, Bun, Next.js route handler'ları, tweet arama, medya tweet'leri ve DM'ler için tipli istek parametreleri, yanıt modelleri, yeniden deneme ve otomatik tamamlama istiyorsanız TypeScript SDK'yı kullanın.

| TypeScript görevi | SDK çağrısı | Saklayın |
| ---------------- | ------------------------ | ------------ |
| Tweet arama | `client.search.advanced` | `nextCursor` |
| Profil okuma | `client.users.getAbout` | `screenName` |
| Takipçi listeleme | `client.users.followers.list` | cursor |

Yazma yüklerini test ederken önce [CLI](/sdks/cli) `--dry-run` kullanın.

## Hata yönetimi

```ts
import { XApiScraper } from "@twexapi-dev/x-api-scraper";
import * as errors from "@twexapi-dev/x-api-scraper/models/errors";

try {
  await client.search.advanced({
    searchTerms: ["from:elonmusk"],
    sortBy: "Latest",
    nextCursor: "",
  });
} catch (error) {
  if (error instanceof errors.XAPIScraperError) {
    console.error(error.statusCode, error.body);
  } else {
    throw error;
  }
}
```

İstemci varsayılan olarak bağlantı hatalarını üstel geri çekilme ile yeniden dener. İstek başına `retries` seçeneğiyle geçersiz kılın.

## Pi kodlama agent paketi

npm'den paketlenmiş TwexAPI Skill'lerini kurun:

```bash
pi install npm:@twexapi-dev/x-api-scraper
```

## Referanslar

* [SDKs overview](/sdks)
* [Authentication](/authentication)
* [MCP Server](/mcp/overview)
* [Advanced Twitter Search](/api-reference/search-endpoints/get-data-page-twitter-advanced-search-page-post)
* [Source Repository](https://github.com/twexapi-dev/x-api-scraper-typescript)
