Skip to content

Latest commit

 

History

History
39 lines (32 loc) · 1.2 KB

File metadata and controls

39 lines (32 loc) · 1.2 KB
package hello.world;

import io.twexapi.sdk.XapiScraper;
import io.twexapi.sdk.models.components.AdvancedSearchCursorQuery;
import io.twexapi.sdk.models.errors.HTTPValidationError;
import io.twexapi.sdk.models.operations.SearchAdvancedResponse;
import java.lang.Exception;
import java.util.List;

public class Application {

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

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

        AdvancedSearchCursorQuery req = AdvancedSearchCursorQuery.builder()
                .searchTerms(List.of(
                    "<value 1>",
                    "<value 2>",
                    "<value 3>"))
                .sortBy("<value>")
                .nextCursor("")
                .build();

        SearchAdvancedResponse res = sdk.search().advanced()
                .request(req)
                .call();

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