NamSor API Java SDK
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.swagger-codegen
docs
gradle/wrapper
src
.gitignore
.swagger-codegen-ignore
.travis.yml
LICENSE
README.md
build.gradle
build.sbt
git_push.sh
gradle.properties
gradlew
gradlew.bat
namsor.asc
pom.xml
settings.gradle

README.md

namsor-java-client

Namsor

  • API version: 1.1.0
    • Build date: 2018-05-28T09:53:22.959+02:00

NamSor SDK infers Gender and Origin from international names

NamSor specialized data mining software recognizes the gender, the linguistic or cultural origin of personal names in any alphabet / language, with fine grain and high accuracy.

Requirements

Building the API client library requires:

  1. Java 1.7+
  2. Maven/Gradle

Installation

To install the API client library to your local Maven repository, simply execute:

mvn clean install

To deploy it to a remote Maven repository instead, configure the settings of the repository and execute:

mvn clean deploy

Refer to the OSSRH Guide for more information.

Maven users

Add this dependency to your project's POM:

<dependency>
  <groupId>com.namsor</groupId>
  <artifactId>namsor-java-client</artifactId>
  <version>1.1.0</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.namsor:namsor-java-client:1.1.0"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/namsor-java-client-1.1.0.jar
  • target/lib/*.jar

Getting Started

Please follow the installation instruction and execute the following Java code:

import com.namsor.*;
import com.namsor.auth.*;
import com.namsor.model.*;
import com.namsor.api.GenderApi;

import java.io.File;
import java.util.*;

public class GenderApiExample {

    public static void main(String[] args) {
        
        GenderApi apiInstance = new GenderApi();
        String firstName = "\"John\""; // String | Firstname
        String lastName = "\"Smith\""; // String | Lastname
        String xChannelSecret = "\"\""; // String | Your API Key (Secret)
        String xChannelUser = "\"\""; // String | Your API Channel (User)
        try {
            OutputNameForGender result = apiInstance.extractGender(firstName, lastName, xChannelSecret, xChannelUser);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling GenderApi#extractGender");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://api.namsor.com/onomastics/api/json

Class Method HTTP request Description
GenderApi extractGender GET /gender/{firstName}/{lastName} To genderize one name
GenderApi extractGenderLocal GET /gender/{firstName}/{lastName}/{countryIso2} To genderize one name, with the context of a given country ISO2
GenderListApi extractGenderList POST /genderList To genderize many names (up to 1000).
OriginApi extractOrigin GET /origin/{firstName}/{lastName} To determin the origin of a name
OriginListApi extractOriginList POST /originList To determin the origin of many names (up to 1000)
ParseApi parseName GET /parse/{fullName} Parse a fullName into firstName, lastName components.
ParseListApi parseList POST /parseList Parse many names (up to 1000)

Documentation for Models

Documentation for Authorization

All endpoints do not require authorization. Authentication schemes defined for the API:

Recommendation

It's recommended to create an instance of ApiClient per thread in a multithreaded environment to avoid any potential issues.

Author

contact@namsor.com