MCPcopy Index your code
hub / github.com/crowdin/crowdin-api-client-java

github.com/crowdin/crowdin-api-client-java @1.33.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release 1.33.0 ↗ · + Follow
2,309 symbols 6,708 edges 762 files 398 documented · 17%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README
<img width="150" height="150" src="https://support.crowdin.com/assets/logos/symbol/png/crowdin-symbol-cDark.png">

Crowdin Java client

The Crowdin Java client is a lightweight interface to the Crowdin API that works in any Java environment. It provides common services for making API requests.

Our API is a full-featured RESTful API that helps you to integrate localization into your development process. The endpoints that we use allow you to easily make calls to retrieve information and to execute actions needed.

API Client Docs  |  Crowdin API  |  Crowdin Enterprise API

JitPack Tests codecov GitHub contributors License

Installation

Gradle

repositories {
    maven { url "https://jitpack.io" }
}
dependencies {
    compile "com.github.crowdin:crowdin-api-client-java:1.33.0"
}

Maven

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

<dependency>
    <groupId>com.github.crowdin</groupId>
    <artifactId>crowdin-api-client-java</artifactId>
    <version>1.33.0</version>
</dependency>

Quick Start

import com.crowdin.client.Client;
import com.crowdin.client.core.model.Credentials;

public class ListProjectBranchesExample {

    public static void main(String[] args) {
        Credentials credentials = new Credentials("token", "organization");
        Client client = new Client(credentials);
        client
            .getSourceFilesApi()
            .listBranches(123L, null, 500, null)
            .getData()
            .forEach(branch -> System.out.println(branch.getData()));
    }

}

Sorting results

You can sort the results of list* methods by one or multiple fields using the OrderByField class.
If sort direction is not specified, results will be sorted in ascending (ASC) order by default.

Example: Sort string comments by id descending

import com.crowdin.client.Client;
import com.crowdin.client.core.model.Credentials;
import com.crowdin.client.stringcomments.model.OrderByField;
import com.crowdin.client.stringcomments.model.SortOrder;
import com.crowdin.client.stringcomments.model.StringComment;

import java.util.Collections;
import java.util.List;

public class ListCommentsSortedExample {

    public static void main(String[] args) {
        Credentials credentials = new Credentials("your-token", "your-organization");
        Client client = new Client(credentials);

        OrderByField orderByIdDesc = new OrderByField();
        orderByIdDesc.setFieldName("id");
        orderByIdDesc.setOrderBy(SortOrder.DESC); // Optional: default is ASC

        List<StringComment> comments = client
                .getStringCommentsApi()
                .listStringComments(
                        123L, // projectId
                        null, null, null, null, null, null,
                        Collections.singletonList(orderByIdDesc)
                )
                .getData()
                .stream()
                .map(response -> response.getData())
                .toList();

        comments.forEach(comment -> System.out.println(comment.getId()));
    }

}

Example: Sort by multiple fields

You can also sort by multiple fields, for example: first by createdAt, then by id.

import java.util.Arrays;
import com.crowdin.client.stringcomments.model.OrderByField;
import com.crowdin.client.stringcomments.model.SortOrder;

public class ListCommentsSortedExample {

    public static void main(String[] args) {
        OrderByField orderByCreatedAtAsc = new OrderByField();
        orderByCreatedAtAsc.setFieldName("createdAt"); // ASC by default

        OrderByField orderByIdDesc = new OrderByField();
        orderByIdDesc.setFieldName("id");
        orderByIdDesc.setOrderBy(SortOrder.DESC);

        List<OrderByField> orderBy = Arrays.asList(orderByCreatedAtAsc, orderByIdDesc);
    }
}

Customization

This client uses Apache http client and Jackson json library.
Usage of these libraries is wrapped into interfaces and gives possibility to override them and use different libraries for http communication or json transformations.

The library entry point is com.crowdin.client.Client and this class has additional constructor where you can specify additional configurations (please refer to javadoc).

Http timeouts

Library allows you to configure http requests timeout.

import com.crowdin.client.Client;
import com.crowdin.client.core.model.ClientConfig;
import com.crowdin.client.core.model.Credentials;

public class Main {

    public static void main(String[] args) {
        Credentials credentials = new Credentials("token", "organization");
        Client client = new Client(credentials, ClientConfig.builder().httpTimeoutMs(5000).build());
    }

}

GraphQL API

This library also provides possibility to use GraphQL API

import com.crowdin.client.Client;
import com.crowdin.client.core.model.Credentials;
import com.crowdin.client.core.model.GraphQLRequest;

import java.util.Map;

public class GraphQLExample {

    public static void main(String[] args) {
        Credentials credentials = new Credentials("token", "organization");
        Client client = new Client(credentials);
        String query = "query { viewer { projects(first: 2) { edges { node { name } } } } }";
        GraphQLRequest request = new GraphQLRequest(query);
        Map<String, Object> response = client.graphql(request).getData();
        System.out.println(response);
    }

}

Seeking Assistance

If you find any problems or would like to suggest a feature, please read the How can I contribute section in our contributing guidelines.

Contributing

If you would like to contribute please read the Contributing guidelines.

License

The Crowdin Java client is licensed under the MIT License. 
See the LICENSE file distributed with this work for additional 
information regarding copyright ownership.

Except as contained in the LICENSE file, the name(s) of the above copyright
holders shall not be used in advertising or otherwise to promote the sale,
use or other dealings in this Software without prior written authorization.

Extension points exported contracts — how you extend this code

EnumConverter (Interface)
Enum json converter. All enums will implement this interface. Enum which implements this interface should also contain s [73 …
src/main/java/com/crowdin/client/core/model/EnumConverter.java
Credentials (Interface)
(no doc) [6 implementers]
src/main/java/com/crowdin/client/machinetranslationengines/model/Credentials.java
HttpClient (Interface)
Http client interface for library. Default implementation ApacheHttpClient uses apache http library Develop own [2 implementers]
src/main/java/com/crowdin/client/core/http/HttpClient.java
JsonTransformer (Interface)
Json serializer/deserializer. Default implementation JacksonJsonTransformer uses jackson json library. For prope [2 implementers]
src/main/java/com/crowdin/client/core/http/JsonTransformer.java
LanguageTranslations (Interface)
(no doc) [3 implementers]
src/main/java/com/crowdin/client/stringtranslations/model/LanguageTranslations.java

Core symbols most depended-on inside this repo

get
called by 816
src/main/java/com/crowdin/client/core/http/HttpClient.java
of
called by 240
src/main/java/com/crowdin/client/core/model/ResponseObject.java
put
called by 225
src/main/java/com/crowdin/client/core/http/HttpClient.java
post
called by 101
src/main/java/com/crowdin/client/core/http/HttpClient.java
buildUrlParams
called by 99
src/main/java/com/crowdin/client/core/http/HttpRequestConfig.java
of
called by 79
src/main/java/com/crowdin/client/core/model/ResponseList.java
delete
called by 64
src/main/java/com/crowdin/client/core/http/HttpClient.java
patch
called by 50
src/main/java/com/crowdin/client/core/http/HttpClient.java

Shape

Method 1,436
Class 801
Enum 66
Interface 6

Languages

Java100%

Modules by API surface

src/main/java/com/crowdin/client/ai/AIApi.java49 symbols
src/test/java/com/crowdin/client/ai/AIApiTest.java48 symbols
src/test/java/com/crowdin/client/sourcefiles/SourceFilesApiTest.java45 symbols
src/test/java/com/crowdin/client/stringtranslations/StringTranslationsApiTest.java35 symbols
src/main/java/com/crowdin/client/reports/ReportsApi.java33 symbols
src/test/java/com/crowdin/client/users/UsersApiTest.java31 symbols
src/test/java/com/crowdin/client/glossaries/GlossariesApiTest.java31 symbols
src/test/java/com/crowdin/client/translations/TranslationsApiTest.java30 symbols
src/test/java/com/crowdin/client/reports/ReportsApiTest.java30 symbols
src/main/java/com/crowdin/client/sourcefiles/SourceFilesApi.java30 symbols
src/main/java/com/crowdin/client/projectsgroups/ProjectsGroupsApi.java29 symbols
src/test/java/com/crowdin/client/tasks/TasksApiTest.java27 symbols

For agents

$ claude mcp add crowdin-api-client-java \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact