Skip to content

Latest commit

 

History

History
354 lines (249 loc) · 15.8 KB

File metadata and controls

354 lines (249 loc) · 15.8 KB

Lists

Overview

Available Operations

tweets

Get list tweets

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ListsTweetsRequest;
import io.twexapi.sdk.models.operations.ListsTweetsResponse;
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();

        ListsTweetsRequest req = ListsTweetsRequest.builder()
                .listId("<id>")
                .targetCount(277741L)
                .build();

        ListsTweetsResponse res = sdk.lists().tweets()
                .request(req)
                .call();

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

Parameters

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

Response

ListsTweetsResponse

Errors

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

tweetsPage

Retrieve a paginated list of list tweets using cursor-based pagination. Each page returns up to 20 tweets. Pass next_cursor from the previous response to continue. Pricing: $0.10 per 1,000 tweets.

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.GetListTweetsCursorQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ListsTweetsPageResponse;
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();

        GetListTweetsCursorQuery req = GetListTweetsCursorQuery.builder()
                .listId("<id>")
                .nextCursor("1234567890")
                .build();

        ListsTweetsPageResponse res = sdk.lists().tweetsPage()
                .request(req)
                .call();

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

Parameters

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

Response

ListsTweetsPageResponse

Errors

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

subscribers

Get list subscribers

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ListsSubscribersRequest;
import io.twexapi.sdk.models.operations.ListsSubscribersResponse;
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();

        ListsSubscribersRequest req = ListsSubscribersRequest.builder()
                .listId("<id>")
                .targetCount(440492L)
                .build();

        ListsSubscribersResponse res = sdk.lists().subscribers()
                .request(req)
                .call();

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

Parameters

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

Response

ListsSubscribersResponse

Errors

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

members

Get list members

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ListsMembersRequest;
import io.twexapi.sdk.models.operations.ListsMembersResponse;
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();

        ListsMembersRequest req = ListsMembersRequest.builder()
                .listId("<id>")
                .targetCount(685648L)
                .build();

        ListsMembersResponse res = sdk.lists().members()
                .request(req)
                .call();

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

Parameters

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

Response

ListsMembersResponse

Errors

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

membersPage

Retrieve a paginated list of list members using cursor-based pagination. Each page returns up to 20 members. Pass next_cursor from the previous response to continue. Pricing: $0.10 per 1,000 members.

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.GetListMembersCursorQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ListsMembersPageResponse;
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();

        GetListMembersCursorQuery req = GetListMembersCursorQuery.builder()
                .listId("<id>")
                .nextCursor("1234567890")
                .build();

        ListsMembersPageResponse res = sdk.lists().membersPage()
                .request(req)
                .call();

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

Parameters

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

Response

ListsMembersPageResponse

Errors

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

search

Search list

Example Usage

package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.SearchListQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.ListsSearchResponse;
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();

        SearchListQuery req = SearchListQuery.builder()
                .query("<value>")
                .targetCount(810476L)
                .build();

        ListsSearchResponse res = sdk.lists().search()
                .request(req)
                .call();

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

Parameters

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

Response

ListsSearchResponse

Errors

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