Skip to content
NamSor API v2 Java SDK - classify personal names accurately by gender, country of origin, or ethnicity.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
gradle/wrapper
src
target
.gitattributes.txt
.gitignore
.travis.yml
LICENSE
README.md
build.gradle
build.sbt
git_push.sh
gradle.properties
gradlew
gradlew.bat
pom.xml
run-java.bash
settings.gradle

README.md

namsor-sdk2

NamSor API v2

  • API version: 2.0.2-beta
    • Build date: 2019-05-11T10:42:18.784+02:00[Europe/Berlin]

NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages. Use GET methods for small tests, but prefer POST methods for higher throughput (batch processing of up to 1000 names at a time). Need something you can't find here? We have many more features coming soon. Let us know, we'll do our best to add it!

For more information, please visit http://www.namsor.com/

Automatically generated by the OpenAPI Generator

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-sdk2</artifactId>
  <version>2.0.2</version>
  <scope>compile</scope>
</dependency>

Gradle users

Add this dependency to your project's build file:

compile "com.namsor:namsor-sdk2:2.0.2"

Others

At first generate the JAR by executing:

mvn clean package

Then manually install the following JARs:

  • target/namsor-sdk2-2.0.2.jar
  • target/lib/*.jar

Getting Started

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

import com.namsor.sdk2.invoke.*;
import com.namsor.sdk2.invoke.auth.*;
import com.namsor.sdk2.model.*;
import com.namsor.sdk2.api.AdminApi;

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

public class AdminApiExample {

    public static void main(String[] args) {
        ApiClient defaultClient = Configuration.getDefaultApiClient();
        
        // Configure API key authorization: api_key
        ApiKeyAuth api_key = (ApiKeyAuth) defaultClient.getAuthentication("api_key");
        api_key.setApiKey("YOUR API KEY");
        // Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
        //api_key.setApiKeyPrefix("Token");

        AdminApi apiInstance = new AdminApi();
        String apiKey = "apiKey_example"; // String | 
        Long usageCredits = 56L; // Long | 
        String userMessage = "userMessage_example"; // String | 
        try {
            SystemMetricsOut result = apiInstance.addCredits(apiKey, usageCredits, userMessage);
            System.out.println(result);
        } catch (ApiException e) {
            System.err.println("Exception when calling AdminApi#addCredits");
            e.printStackTrace();
        }
    }
}

Documentation for API Endpoints

All URIs are relative to https://v2.namsor.com/NamSorAPIv2

Class Method HTTP request Description
AdminApi addCredits GET /api2/json/addCredits/{apiKey}/{usageCredits}/{userMessage} Add usage credits to an API Key.
AdminApi apiUsage GET /api2/json/apiUsage Print current API usage.
AdminApi apiUsageHistory GET /api2/json/apiUsageHistory Print historical API usage.
AdminApi apiUsageHistoryAggregate GET /api2/json/apiUsageHistoryAggregate Print historical API usage (in an aggregated view, by service, by day/hour/min).
AdminApi availablePlans GET /api2/json/availablePlans/{token} List all available plans in the user's preferred currency.
AdminApi availablePlans1 GET /api2/json/availablePlans List all available plans in the default currency (usd).
AdminApi availableServices GET /api2/json/apiServices List of API services and usage cost in Units (default is 1=ONE Unit).
AdminApi billingCurrencies GET /api2/json/billingCurrencies List possible currency options for billing (USD, EUR, GBP, ...)
AdminApi billingHistory GET /api2/json/billingHistory/{token} Read the history billing information (invoices paid via Stripe or manually).
AdminApi billingInfo GET /api2/json/billingInfo/{token} Read the billing information (company name, address, phone, vat ID)
AdminApi charge POST /api2/json/charge Create a Stripe Customer, based on a payment card token (from secure StripeJS) and email.
AdminApi corporateKey GET /api2/json/corporateKey/{apiKey}/{corporate} Setting an API Key to a corporate status.
AdminApi debugLevel GET /api2/json/debugLevel/{logger}/{level} Update debug level for a classifier
AdminApi flush GET /api2/json/flush Flush counters.
AdminApi invalidateCache GET /api2/json/invalidateCache Invalidate system caches.
AdminApi learnable GET /api2/json/learnable/{source}/{learnable} Activate/deactivate learning from a source.
AdminApi namsorCounter GET /api2/json/namsorCounter Get the overall API counter
AdminApi paymentInfo GET /api2/json/paymentInfo/{token} Get the Stripe payment information associated with the current google auth session token.
AdminApi procureKey GET /api2/json/procureKey/{token} Procure an API Key (sent via Email), based on an auth token. Keep your API Key secret.
AdminApi redeployUI GET /api2/json/redeployUI Redeploy UI from current dev branch.
AdminApi redeployUI1 GET /api2/json/redeployUI/{live} Redeploy UI from current dev branch.
AdminApi removeUserAccount GET /api2/json/removeUserAccount/{token} Subscribe to a give API plan, using the user's preferred or default currency.
AdminApi shutdown GET /api2/json/shutdown Stop learning and shutdown system.
AdminApi softwareVersion GET /api2/json/softwareVersion Get the current software version
AdminApi sourceStats GET /api2/json/sourceStats/{source} Print basic source statistics.
AdminApi stats GET /api2/json/stats Print basic system statistics.
AdminApi stripeConnect GET /api2/json/stripeConnect Connects a Stripe Account.
AdminApi subscribePlan GET /api2/json/subscribePlan/{planName}/{token} Subscribe to a give API plan, using the user's preferred or default currency.
AdminApi updateBillingInfo POST /api2/json/updateBillingInfo/{token} Sets or update the billing information (company name, address, phone, vat ID)
AdminApi updateLimit GET /api2/json/updateLimit/{usageLimit}/{hardOrSoft}/{token} Modifies the hard/soft limit on the API plan's overages (default is 0$ soft limit).
AdminApi updatePaymentDefault GET /api2/json/updatePaymentDefault/{defautSourceId}/{token} Update the default Stripe card associated with the current google auth session token.
AdminApi userInfo GET /api2/json/userInfo/{token} Get the user profile associated with the current google auth session token.
AdminApi verifyEmail GET /api2/json/verifyEmail/{emailToken} Verifies an email, based on token sent to that email
AdminApi verifyRemoveEmail GET /api2/json/verifyRemoveEmail/{emailToken} Verifies an email, based on token sent to that email
AdminApi vet GET /api2/json/vetting/{source}/{vetted} Vetting of a source.
ChineseApi chineseNameCandidates GET /api2/json/chineseNameCandidates/{chineseSurnameLatin}/{chineseGivenNameLatin} Identify Chinese name candidates, based on the romanized name.
ChineseApi chineseNameCandidatesBatch POST /api2/json/chineseNameCandidatesBatch Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname).
ChineseApi chineseNameCandidatesGenderBatch POST /api2/json/chineseNameCandidatesGenderBatch Identify Chinese name candidates, based on the romanized name (firstName = chineseGivenName; lastName=chineseSurname).
ChineseApi chineseNameGenderCandidates GET /api2/json/chineseNameGenderCandidates/{chineseSurnameLatin}/{chineseGivenNameLatin}/{knownGender} Identify Chinese name candidates, based on the romanized name - having a known gender ('male' or 'female')
PersonalApi country GET /api2/json/country/{personalNameFull} [USES 10 UNITS] Infer the likely country of residence of a personal full name, or one surname. Assumes names as they are in the country of residence OR the country of origin.
PersonalApi countryBatch POST /api2/json/countryBatch [USES 10 UNITS] Infer the likely country of residence of up to 1000 personal full names, or surnames. Assumes names as they are in the country of residence OR the country of origin.
PersonalApi diaspora GET /api2/json/diaspora/{countryIso2}/{firstName}/{lastName} [USES 20 UNITS] Infer the likely ethnicity/diaspora of a personal name, given a country of residence ISO2 code (ex. US, CA, AU, NZ etc.)
PersonalApi diasporaBatch POST /api2/json/diasporaBatch [USES 20 UNITS] Infer the likely ethnicity/diaspora of up to 1000 personal names, given a country of residence ISO2 code (ex. US, CA, AU, NZ etc.)
PersonalApi gender GET /api2/json/gender/{firstName}/{lastName} Infer the likely gender of a name.
PersonalApi genderBatch POST /api2/json/genderBatch Infer the likely gender of up to 1000 names, detecting automatically the cultural context.
PersonalApi genderFull GET /api2/json/genderFull/{fullName} Infer the likely gender of a full name, ex. John H. Smith
PersonalApi genderFullBatch POST /api2/json/genderFullBatch Infer the likely gender of up to 1000 full names, detecting automatically the cultural context.
PersonalApi genderFullGeo GET /api2/json/genderFullGeo/{fullName}/{countryIso2} Infer the likely gender of a full name, given a local context (ISO2 country code).
PersonalApi genderFullGeoBatch POST /api2/json/genderFullGeoBatch Infer the likely gender of up to 1000 full names, with a given cultural context (country ISO2 code).
PersonalApi genderGeo GET /api2/json/genderGeo/{firstName}/{lastName}/{countryIso2} Infer the likely gender of a name, given a local context (ISO2 country code).
PersonalApi genderGeoBatch POST /api2/json/genderGeoBatch Infer the likely gender of up to 1000 names, each given a local context (ISO2 country code).
PersonalApi origin GET /api2/json/origin/{firstName}/{lastName} [USES 10 UNITS] Infer the likely country of origin of a personal name. Assumes names as they are in the country of origin. For US, CA, AU, NZ and other melting-pots : use 'diaspora' instead.
PersonalApi originBatch POST /api2/json/originBatch [USES 10 UNITS] Infer the likely country of origin of up to 1000 names, detecting automatically the cultural context.
PersonalApi parseName GET /api2/json/parseName/{nameFull} Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John.
PersonalApi parseNameBatch POST /api2/json/parseNameBatch Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John.
PersonalApi parseNameGeo GET /api2/json/parseName/{nameFull}/{countryIso2} Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John. For better accuracy, provide a geographic context.
PersonalApi parseNameGeoBatch POST /api2/json/parseNameGeoBatch Infer the likely first/last name structure of a name, ex. John Smith or SMITH, John or SMITH; John. Giving a local context improves precision.
PersonalApi parsedGenderBatch POST /api2/json/parsedGenderBatch Infer the likely gender of up to 1000 fully parsed names, detecting automatically the cultural context.
PersonalApi parsedGenderGeoBatch POST /api2/json/parsedGenderGeoBatch Infer the likely gender of up to 1000 fully parsed names, detecting automatically the cultural context.
PersonalApi usRaceEthnicity GET /api2/json/usRaceEthnicity/{firstName}/{lastName} [USES 10 UNITS] Infer a US resident's likely race/ethnicity according to US Census taxonomy W_NL (white, non latino), HL (hispano latino), A (asian, non latino), B_NL (black, non latino).
PersonalApi usRaceEthnicityBatch POST /api2/json/usRaceEthnicityBatch [USES 10 UNITS] Infer up-to 1000 US resident's likely race/ethnicity according to US Census taxonomy.
PersonalApi usRaceEthnicityZIP5 GET /api2/json/usRaceEthnicityZIP5/{firstName}/{lastName}/{zip5Code} [USES 10 UNITS] Infer a US resident's likely race/ethnicity according to US Census taxonomy, using (optional) ZIP5 code info. Output is W_NL (white, non latino), HL (hispano latino), A (asian, non latino), B_NL (black, non latino).
PersonalApi usZipRaceEthnicityBatch POST /api2/json/usZipRaceEthnicityBatch [USES 10 UNITS] Infer up-to 1000 US resident's likely race/ethnicity according to US Census taxonomy, with (optional) ZIP code.
SocialApi phoneCode GET /api2/json/phoneCode/{firstName}/{lastName}/{phoneNumber} [USES 11 UNITS] Infer the likely country and phone prefix, given a personal name and formatted / unformatted phone number.
SocialApi phoneCodeBatch POST /api2/json/phoneCodeBatch [USES 11 UNITS] Infer the likely country and phone prefix, of up to 1000 personal names, detecting automatically the local context given a name and formatted / unformatted phone number.
SocialApi phoneCodeGeo GET /api2/json/phoneCodeGeo/{firstName}/{lastName}/{phoneNumber}/{countryIso2} [USES 11 UNITS] Infer the likely phone prefix, given a personal name and formatted / unformatted phone number, with a local context (ISO2 country of residence).
SocialApi phoneCodeGeoBatch POST /api2/json/phoneCodeGeoBatch [USES 11 UNITS] Infer the likely country and phone prefix, of up to 1000 personal names, with a local context (ISO2 country of residence).
SocialApi phoneCodeGeoFeedbackLoop GET /api2/json/phoneCodeGeoFeedbackLoop/{firstName}/{lastName}/{phoneNumber}/{phoneNumberE164}/{countryIso2} [CREDITS 1 UNIT] Feedback loop to better infer the likely phone prefix, given a personal name and formatted / unformatted phone number, with a local context (ISO2 country of residence).

Documentation for Models

Documentation for Authorization

Authentication schemes defined for the API:

api_key

  • Type: API key
  • API key parameter name: X-API-KEY
  • Location: HTTP header

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

You can’t perform that action at this time.