Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

TalorData Java Library

TalorData official Java SDK for integrating search data into your AI workflow, RAG / fine-tuning, or Java application. TalorData helps developers and AI applications connect to real-time, structured, and reliable search data through a single SERP API. With support for Google, Bing, News, Images, Shopping, Maps, Scholar, Trends, and more, TalorData makes it easier to build AI agents, search copilots, SEO workflows, and data-driven automations powered by live search results.

Install

This library can be consumed through JitPack after you create and push a Git tag.

Maven

Add the JitPack repository:

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

Then add the dependency:

<dependency>
    <groupId>com.github.Talordata</groupId>
    <artifactId>talordata-serp-java</artifactId>
    <version>v0.1.0</version>
</dependency>

Gradle

repositories {
    mavenCentral()
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.Talordata:talordata-serp-java:v0.1.0'
}

Release Notes

  • JitPack coordinates follow com.github.<GitHubUser>:<RepoName>:<GitTag>.

  • The version must match an existing Git tag such as v0.1.0.

  • Once the tag is pushed to GitHub, JitPack will build the artifact from this repository automatically.

Quick Start

Sign up at TalorData and get your API key from the dashboard.

import com.talordata.serp.Client;
import com.talordata.serp.SerpResults;
import java.util.Map;

public class Main {
    public static void main(String[] args) {
        Client client = new Client(System.getenv("TALORDATA_API_TOKEN"));

        Object result = client.search(Map.of(
            "engine", "google",
            "q", "car"
        ));

        if (result instanceof SerpResults) {
            SerpResults serpResults = (SerpResults) result;
            System.out.println(serpResults.getStatus());
            System.out.println(serpResults.get("search_information"));
        } else {
            System.out.println(result);
        }
    }
}

You can also set the token once in your shell:

export TALORDATA_API_TOKEN=your_token

Then use the static helper:

import com.talordata.serp.TalorDataSerp;
import java.util.Map;

public class Main {
    public static void main(String[] args) {
        Object result = TalorDataSerp.search(Map.of(
            "engine", "google",
            "q", "car"
        ));

        System.out.println(result);
    }
}

Examples

  • examples/BasicSearch.java: basic json=1 search example.

  • examples/JsonPlusHtml.javajson=2 example with both HTML and parsed JSON.

  • examples/HtmlOutput.javajson=3 example that prints HTML output.

API Design

  • new Client(...): create a reusable client.

  • client.search(...): send a form-encoded POST request to /serp/v1/request and return the parsed result.

  • client.searchJson(...): alias of search(...).

  • client.searchHtml(...): return the HTML string for json=3.

  • client.rawSearch(...): return the raw HTTP response body.

JSON Modes

  • json=1: returns parsed JSON data. This is the default mode used by client.search(...).

  • json=2: returns both html and json. The SDK automatically parses data.json into a Java object when possible.

  • json=3: returns HTML. The SDK unwraps the HTML string from the API response.

Example With URL

import com.talordata.serp.Client;
import java.util.Map;

public class Main {
    public static void main(String[] args) {
        Client client = new Client(System.getenv("TALORDATA_API_TOKEN"));

        Object result = client.search(Map.of(
            "url", "https://www.google.com/search",
            "q", "car",
            "json", 1
        ));

        System.out.println(result);
    }
}

Notes

  • Auth uses the Authorization: Bearer <token> header.

  • Requests are sent as application/x-www-form-urlencoded.

  • Boolean params are normalized to "1" and "0" before sending.

Learn more

Explore TalorData SERP API integrations and use cases:

Quick Start

View Documentation

Releases

Packages

Used by

Contributors

Languages