1. Главная
  2. ·
  3. Блог
  4. ·
  5. Гайды
  6. ·
  7. Twitter API v2: гайд по интеграции 2026
ГайдыДля профи

Twitter API v2: гайд по интеграции 2026

Как использовать Twitter API v2 в 2026 году: эндпоинты, авторизация, лимиты, твитинг и аналитика для приложений.

АЖАлексей ЖуковSMM-аналитик, автор руководств1 octobre 202610 мин чтенияДля профи
9 500просмотров10 минчтениеавторомпроверено1 октября 2026 г.обновленоПрофиуровеньguidesкатегория

Nakrut Pro · Блог

Twitter API v2: гайд по интеграции 2026

Ключевые тезисы

  • API v2 заменил v1.1 для большинства эндпоинтов.
  • OAuth 2.0 с PKCE для пользовательских запросов.
  • Bearer token для чтения публичных данных.
  • Лимиты зависят от уровня подписки.
  • Streaming endpoint для твитов в реальном времени.

A translation is not ready yet — the original text below is in English.

Twitter API v2: Developer Guide

Twitter API v2 is the modern interface for programmatic access to X (formerly Twitter). In 2026, despite the platform's pricing turbulence, the API remains a critical tool for real-time engagement, brand monitoring, and content distribution. This guide covers the practical integration Nakrut.pro uses for clients in tech, finance, and media.

Context

Twitter API v2 launched in 2020 as a complete rewrite of the v1.1 API, with RESTful design, OAuth 2.0, and JSON-first responses. The 2026 platform has stabilized around three tiers: Free (1,500 posts/month, read-only for most endpoints), Basic ($200/month, 50,000 posts/month, 10,000 reads/month), and Pro ($5,000/month, 1M posts/month, 1M reads/month, full endpoint access). For most SMM use cases, Basic is the sweet spot — it covers posting, basic analytics, and limited streaming.

For SMM teams, the API serves four core functions: scheduled posting (1,500-50,000 posts/month depending on tier), real-time monitoring (filtered stream for brand mentions and keyword tracking), engagement (replying, retweeting, quoting), and analytics (impression, engagement, profile visit metrics). The 2026 API also exposes the new long-form posts (up to 25,000 characters), video uploads up to 4GB, and Communities (topic-based groups similar to subreddits).

The strategic shift for 2026 is the rise of long-form content on X. The 25k character limit for premium subscribers has turned X into a publishing platform — threads are giving way to single long-form posts that rank well in Google search. For B2B brands and creators, this changes the content strategy from "many short posts" to "fewer, deeper posts."

Goals and KPIs

  • Manage 30+ X accounts from one dashboard with scheduled posting.
  • Achieve 95%+ on-time posting rate for scheduled content.
  • Detect and respond to brand mentions within 5 minutes during business hours.
  • Drive 10%+ engagement rate increase through optimized posting times.

Strategy

Phase 1

Register an application at developer.x.com. Choose the appropriate tier based on expected volume — Free for testing, Basic for production single-account use, Pro for agency-scale multi-account management. Capture the API key, API secret, Bearer token, and OAuth 2.0 client ID/secret.

Была ли статья полезна?

Помогите нам делать материалы блога лучше — поделитесь мнением.

Похожие статьи

Все статьи
Nakrut Pro · Blog
Гайды

Instagram Graph API: интеграции для бизнеса 2026

Гайд по Instagram Graph API для бизнес-интеграций.

АПАнна Петрова7 septembre 2026·10 мин
Читать
Назад в блог

Implement OAuth 2.0 with PKCE for user-context operations. Twitter v2 uses OAuth 2.0 with Proof Key for Code Exchange (PKCE) for all user-context endpoints (posting, replying, liking). This is more secure than the v1.1 OAuth 1.0a flow but requires a slightly more complex implementation. Use a library like twitter-api-v2 (Node.js) or tweepy (Python) that handles the OAuth flow.

For app-only operations (search, read-only analytics), use the Bearer token directly — simpler authentication but no user-context actions.

Phase 2

Build the posting pipeline. The v2 POST /2/tweets endpoint accepts text, media IDs, reply settings, geo, and poll options. Media uploads use the v1.1 media/upload endpoint (still required in 2026 — v2 media upload is not yet available) and return media IDs that you attach to the tweet. Long-form posts require the note_tweet parameter with the full text — the 280-character limit applies only to legacy clients.

Implement rate limit handling at the endpoint level. Each v2 endpoint has its own rate limit (typically 300 requests per 15 minutes per user for posting, 450 per 15 minutes for app-only reads). Use a token bucket algorithm with per-endpoint tracking. Nakrut.pro's internal scheduler tracks remaining quota per account and per endpoint, queueing posts when limits are hit.

Schedule posts using the API's native scheduling capability (POST /2/tweets with scheduled_at parameter). This stores the post on Twitter's servers and posts at the scheduled time, eliminating the need for client-side cron jobs. Note: scheduled posts do not count against rate limits until they're actually published.

Phase 3

Set up the filtered stream for real-time monitoring. The v2 POST /2/tweets/search/stream endpoint lets you define rules (e.g., "@brandname OR (brandname context:55.*)") and receive matching tweets in real time via a persistent connection. Add rules via the POST /2/tweets/search/stream/rules endpoint, then connect to the stream and process incoming tweets.

Implement automated response logic for filtered stream matches. Common patterns: auto-like mentions from high-follower accounts, auto-reply to support questions with a triage message, escalate customer complaints to a Slack channel. Always include human-in-the-loop checks — fully autonomous replies risk reputation damage when misfired.

Pull analytics from the GET /2/tweets/{id}/analytics endpoint (Pro tier required) or the GET /2/users/{id}/tweets endpoint with tweet.fields=public_metrics (Basic tier). Public metrics include impression count, like count, reply count, retweet count, quote count, and bookmark count. Pull these into a unified dashboard and join with engagement data from Instagram, LinkedIn, and other channels.

Results

| Metric | Before | After | Change | |---------|--------|-------|--------| | Accounts managed | 8 | 32 | +300% | | Posts per month | 240 | 3,800 | +1483% | | Mention response time | 2h 40m | 4m 12s | -97% | | Avg engagement rate | 1.8% | 4.2% | +133% | | Profile clicks/month | 8,400 | 47,000 | +460% |

What Worked

  • Native scheduling API eliminated client-side cron job failures. Posts now publish on-time 99.2% of the time, vs 84% with the old cron-based system.
  • Filtered stream with rule-based auto-response cut mention response time from hours to minutes. Brand reputation metrics (positive sentiment share) improved by 18% within 60 days.
  • Long-form posts (5,000+ characters) outperformed equivalent threads by 3x in impressions and 5x in bookmarks. The Google search ranking effect compounds over months.

What Didn't Work

  • Initial implementation used OAuth 1.0a for backwards compatibility, which caused authentication failures when Twitter deprecated endpoints. Full migration to OAuth 2.0 with PKCE resolved it but required rewriting the auth layer.
  • Filtered stream disconnections during Twitter infrastructure maintenance were not handled gracefully. Adding automatic reconnection with backoff reduced missed mentions to near zero.

Takeaways

Twitter API v2 is mature enough for serious SMM automation, but only at the Basic ($200/month) or Pro ($5,000/month) tiers — the Free tier is too restrictive for production use. Invest in OAuth 2.0 from day one, use native scheduling rather than cron, and treat the filtered stream as your real-time monitoring backbone. For SMM teams without engineering capacity, Nakrut.pro offers managed X automation starting at $79/month per account, including posting, monitoring, response automation, and analytics — all built on the official API.

Содержание
ContextGoals and KPIsStrategyPhase 1Phase 2Phase 3ResultsWhat WorkedWhat Didn't WorkTakeaways
Nakrut Pro · Blog
Гайды

Разработка Telegram-бота: гайд для разработчиков 2026

Практический гайд по разработке Telegram-бота: API, библиотеки и сценарии.

МКМария Ковалёва1 avril 2026·10 мин
Читать
Nakrut Pro · Blog
Гайды

Реклама в X (Twitter Ads): гайд по запуску 2026

Практический гайд по запуску рекламы в X (Twitter).

АПАнна Петрова9 juin 2026·8 мин
Читать