Skip to content

Latest commit

 

History

History
124 lines (87 loc) · 5.73 KB

File metadata and controls

124 lines (87 loc) · 5.73 KB

Users.Followers

Overview

Available Operations

  • list - Get Followers (v3)
  • verified - Get Verified Followers

list

Get followers of a user. Page size 10-100; use cursor for more pages. $0.10/1000 users.

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.FollowersFollowingV3Query;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.UsersFollowersListResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws HTTPValidationError, Exception {

        XapiScraper sdk = XapiScraper.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        FollowersFollowingV3Query req = FollowersFollowingV3Query.builder()
                .username("elonmusk")
                .count(20L)
                .cursor("1870681402093130182|2076960004551737340")
                .build();

        UsersFollowersListResponse res = sdk.users().followers().list()
                .request(req)
                .call();

        if (res.verifiedFollowersResponse().isPresent()) {
            System.out.println(res.verifiedFollowersResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
request FollowersFollowingV3Query ✔️ The request object to use for the request.

Response

UsersFollowersListResponse

Errors

Error Type Status Code Content Type
models/errors/HTTPValidationError 422 application/json
models/errors/APIException 4XX, 5XX */*

verified

Get blue-verified followers of a user. Page size 10-100; use cursor for more pages. $0.10/1000 users.

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.FollowersFollowingV3Query;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.UsersFollowersVerifiedResponse;
import java.lang.Exception;

public class Application {

    public static void main(String[] args) throws HTTPValidationError, Exception {

        XapiScraper sdk = XapiScraper.builder()
                .bearerAuth(System.getenv().getOrDefault("BEARER_AUTH", ""))
            .build();

        FollowersFollowingV3Query req = FollowersFollowingV3Query.builder()
                .username("elonmusk")
                .count(20L)
                .cursor("1870681402093130182|2076960004551737340")
                .build();

        UsersFollowersVerifiedResponse res = sdk.users().followers().verified()
                .request(req)
                .call();

        if (res.verifiedFollowersResponse().isPresent()) {
            System.out.println(res.verifiedFollowersResponse().get());
        }
    }
}

Parameters

Parameter Type Required Description
request FollowersFollowingV3Query ✔️ The request object to use for the request.

Response

UsersFollowersVerifiedResponse

Errors

Error Type Status Code Content Type
models/errors/HTTPValidationError 422 application/json
models/errors/APIException 4XX, 5XX */*