twitter_openapi_dart 0.0.2 copy "twitter_openapi_dart: ^0.0.2" to clipboard
twitter_openapi_dart: ^0.0.2 copied to clipboard

Implementation of Twitter internal API in Dart.

twitter_openapi_dart #

Human-friendly Twitter OpenAPI

Sample app #

Setup #

dart pub add twitter_openapi_dart

Usage #

import 'package:twitter_openapi_dart/twitter_openapi_dart.dart';

Login #

Flutter (Recommendation)

Load cookie from flutter_inappwebview.

final api = TwitterOpenapiDart()..addBeforInterceptor(FlutterInappwebviewDio());
final client = await api.getClient();

Other

import 'package:twitter_openapi_dart/twitter_openapi_dart.dart';
final api = TwitterOpenapiDart();
final client = await api.getClientFromCookies(authToken: "<auth token here>", ct0: "<csrf token here>");

Do not login

final api = TwitterOpenapiDart();
final client = await api.getClient();

API #

test may be able to help you.

// https://twitter.com/elonmusk/status/1349129669258448897
final result = await client.getTweetApi().getTweetDetail(focalTweetId: "1349129669258448897");
if (result.cursor.bottom?.value == null) return;
final bottom = await client.getTweetApi().getTweetDetail(focalTweetId: "1349129669258448897", cursor: result.cursor.bottom?.value);