Namsor

Admin API – Manage your account and API keys

Namsor's Admin API allows you to manage your account and API keys.

Api Status

GET
  • Cost: 1 credit per name.
  • Description: Returns the current version of the Namsor software and the status of the classifiers (API services).
  • More about: Api Status

HTTP request

http request
GET
https://v2.namsor.com/NamSorAPIv2/api2/json/apiStatus
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Response
NameTypeDescription
softwareVersionObjectSoftware version information.
softwareNameAndVersionStringName and version of the API.
softwareVersionArraySoftware version, as an array (major, minor and patch).
classifierNameStringName of the classifier / service.
servingBooleanTrue if the classifier is serving requests (has reached minimal learning, is not shutting down).
learningBooleanTrue if the classifier is learning.
shuttingDownBooleanTrue if the classifier is shutting down.
probabilityCalibratedBooleanTrue if the classifier has finished the initial learning and has calibrated probabilities (during initial learning, calibrated probabilities will be equal to -1).

Code sample:

Api Status code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/apiStatus \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "softwareVersion": {
        "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
        "softwareVersion": [
            2,
            0,
            14
        ]
    },
    "classifiers": [
        {
            "classifierName": "name_category",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": false
        },
        {
            "classifierName": "personalname_gender",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": true
        }
    ]
}

Api Status code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/apiStatus")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "softwareVersion": {
        "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
        "softwareVersion": [
            2,
            0,
            14
        ]
    },
    "classifiers": [
        {
            "classifierName": "name_category",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": false
        },
        {
            "classifierName": "personalname_gender",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": true
        }
    ]
}

Api Status code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/apiStatus"

headers = {
  "X-API-KEY": "your-api-key",
 "Accept": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

The above command returns JSON structured like this:

{
    "softwareVersion": {
        "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
        "softwareVersion": [
            2,
            0,
            14
        ]
    },
    "classifiers": [
        {
            "classifierName": "name_category",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": false
        },
        {
            "classifierName": "personalname_gender",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": true
        }
    ]
}

Api Status code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/apiStatus", {
  "method": "GET",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json"
  }
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

The above command returns JSON structured like this:

{
    "softwareVersion": {
        "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
        "softwareVersion": [
            2,
            0,
            14
        ]
    },
    "classifiers": [
        {
            "classifierName": "name_category",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": false
        },
        {
            "classifierName": "personalname_gender",
            "serving": true,
            "learning": true,
            "shuttingDown": false,
            "probabilityCalibrated": true
        }
    ]
}

Api Usage

GET
  • Cost: 1 credit per name.
  • Description: Returns information on your subscription plan, billing period and current API usage.
  • More about: Api Usage

HTTP request

http request
GET
https://v2.namsor.com/NamSorAPIv2/api2/json/apiUsage
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Response
NameTypeDescription
subscriptionObjectSubscription information.
apiKeyStringYour Namsor API key.
planStartedNumberStart date of the plan, in UNIX time format.
priorPlanStartedNumberDatetime when the user subscribed to the prior plan.
planEndedNumberEnd date of the plan, in UNIX time format.
taxRateNumberApplicable tax rate for the plan.
planNameStringName of the plan.
planBaseFeesKeyStringCurrent plan key (as in Stripe product).
planStatusStringPlan status.
planQuotaNumberTotal number of credits associated with this plan.
priceUSDNumberPrice in US dollars ($).
priceOverageUSDNumberOverage price in US dollars ($).
priceNumberPrice in the user's preferred currency.
priceOverageNumberOveraged price in the user's preferred currency.
currencyStringThe user's preferred currency.
currencyFactorNumberFor USD, GBP, EUR - the factor is 1.
stripeCustomerIdStringUnique Stripe Customer identifier.
stripeStatusStringStripe status.
stripeSubscriptionStringStripe subscription identifier.
userIdStringUnique user identifier.
billingPeriodObjectBilling information.
apiKeyStringYour Namsor API key.
subscriptionStartedNumberSubscription start date, in UNIX time format.
periodStartedNumberSubscription period start date, in UNIX time format.
periodEndedNumberSubscription end date, in UNIX time format.
stripeCurrentPeriodEndNumberEnd of the current plan in Stripe.
stripeCurrentPeriodStartNumberStart of the current plan in Stripe.
billingStatusStringStatus of the current period billing.
usageNumberNumber of credits used so far.
softLimitNumberCurrent soft limit for the period.
hardLimitNumberCurrent hard limit for the period.
overageExclTaxNumberOverage amount excluding tax.
overageInclTaxNumberOverage amount including tax (if applicable).
overageCurrencyStringCurrency of the overage amount.
overageQuantityNumberQuantity above monthly quota of the current subscritpion, in credits.

Code sample:

Api Usage code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/apiUsage \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "subscription": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "planStarted": 1602705605199,
        "priorPlanStarted": 0,
        "planEnded": 0,
        "taxRate": 0,
        "planName": "BASIC",
        "planBaseFeesKey": "namsorapi_v2_BASIC_usd",
        "planStatus": "OPEN",
        "planQuota": 5000,
        "priceUSD": 0,
        "priceOverageUSD": 0.005,
        "price": 0,
        "priceOverage": 0.005,
        "currency": "usd",
        "currencyFactor": 1,
        "stripeCustomerId": null,
        "stripeStatus": null,
        "stripeSubscription": null,
        "userId": "GYUAUzTKPusJ3aqUH5gQte0dOQCr"
    },
    "billingPeriod": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "subscriptionStarted": 1602705635199,
        "periodStarted": 1618430435199,
        "periodEnded": 0,
        "stripeCurrentPeriodEnd": 0,
        "stripeCurrentPeriodStart": 0,
        "billingStatus": "OPEN",
        "usage": 34,
        "softLimit": 3000,
        "hardLimit": 5000
    },
    "overageExclTax": 0,
    "overageInclTax": 0,
    "overageCurrency": null,
    "overageQuantity": 0
}

Api Usage code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/apiUsage")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "subscription": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "planStarted": 1602705605199,
        "priorPlanStarted": 0,
        "planEnded": 0,
        "taxRate": 0,
        "planName": "BASIC",
        "planBaseFeesKey": "namsorapi_v2_BASIC_usd",
        "planStatus": "OPEN",
        "planQuota": 5000,
        "priceUSD": 0,
        "priceOverageUSD": 0.005,
        "price": 0,
        "priceOverage": 0.005,
        "currency": "usd",
        "currencyFactor": 1,
        "stripeCustomerId": null,
        "stripeStatus": null,
        "stripeSubscription": null,
        "userId": "GYUAUzTKPusJ3aqUH5gQte0dOQCr"
    },
    "billingPeriod": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "subscriptionStarted": 1602705635199,
        "periodStarted": 1618430435199,
        "periodEnded": 0,
        "stripeCurrentPeriodEnd": 0,
        "stripeCurrentPeriodStart": 0,
        "billingStatus": "OPEN",
        "usage": 34,
        "softLimit": 3000,
        "hardLimit": 5000
    },
    "overageExclTax": 0,
    "overageInclTax": 0,
    "overageCurrency": null,
    "overageQuantity": 0
}

Api Usage code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/apiUsage"

headers = {
  "X-API-KEY": "your-api-key",
 "Accept": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

The above command returns JSON structured like this:

{
    "subscription": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "planStarted": 1602705605199,
        "priorPlanStarted": 0,
        "planEnded": 0,
        "taxRate": 0,
        "planName": "BASIC",
        "planBaseFeesKey": "namsorapi_v2_BASIC_usd",
        "planStatus": "OPEN",
        "planQuota": 5000,
        "priceUSD": 0,
        "priceOverageUSD": 0.005,
        "price": 0,
        "priceOverage": 0.005,
        "currency": "usd",
        "currencyFactor": 1,
        "stripeCustomerId": null,
        "stripeStatus": null,
        "stripeSubscription": null,
        "userId": "GYUAUzTKPusJ3aqUH5gQte0dOQCr"
    },
    "billingPeriod": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "subscriptionStarted": 1602705635199,
        "periodStarted": 1618430435199,
        "periodEnded": 0,
        "stripeCurrentPeriodEnd": 0,
        "stripeCurrentPeriodStart": 0,
        "billingStatus": "OPEN",
        "usage": 34,
        "softLimit": 3000,
        "hardLimit": 5000
    },
    "overageExclTax": 0,
    "overageInclTax": 0,
    "overageCurrency": null,
    "overageQuantity": 0
}

Api Usage code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/apiUsage", {
  "method": "GET",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json"
  }
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

The above command returns JSON structured like this:

{
    "subscription": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "planStarted": 1602705605199,
        "priorPlanStarted": 0,
        "planEnded": 0,
        "taxRate": 0,
        "planName": "BASIC",
        "planBaseFeesKey": "namsorapi_v2_BASIC_usd",
        "planStatus": "OPEN",
        "planQuota": 5000,
        "priceUSD": 0,
        "priceOverageUSD": 0.005,
        "price": 0,
        "priceOverage": 0.005,
        "currency": "usd",
        "currencyFactor": 1,
        "stripeCustomerId": null,
        "stripeStatus": null,
        "stripeSubscription": null,
        "userId": "GYUAUzTKPusJ3aqUH5gQte0dOQCr"
    },
    "billingPeriod": {
        "apiKey": "v7menlws2yo8r2mnm10f3uai53tmblth",
        "subscriptionStarted": 1602705635199,
        "periodStarted": 1618430435199,
        "periodEnded": 0,
        "stripeCurrentPeriodEnd": 0,
        "stripeCurrentPeriodStart": 0,
        "billingStatus": "OPEN",
        "usage": 34,
        "softLimit": 3000,
        "hardLimit": 5000
    },
    "overageExclTax": 0,
    "overageInclTax": 0,
    "overageCurrency": null,
    "overageQuantity": 0
}

Available Services

GET
  • Cost: 1 credit per name.
  • Description: Returns a list of the API services (classifiers) and their usage costs in credits.
  • More about: Available Services

HTTP request

http request
GET
https://v2.namsor.com/NamSorAPIv2/api2/json/apiServices
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Response
NameTypeDescription
serviceNameStringName of the classifier / service.
serviceGroupStringGroup the classifier / service belong to.
costInUnitsNumberUsage cost of the service, in credits.

Code sample:

Available Services code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/apiServices \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "serviceName": "name_category",
    "serviceGroup": "general",
    "costInUnits": 1
}

Available Services code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/apiServices")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "serviceName": "name_category",
    "serviceGroup": "general",
    "costInUnits": 1
}

Available Services code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/apiServices"

headers = {
  "X-API-KEY": "your-api-key",
 "Accept": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

The above command returns JSON structured like this:

{
    "serviceName": "name_category",
    "serviceGroup": "general",
    "costInUnits": 1
}

Available Services code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/apiServices", {
  "method": "GET",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json"
  }
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

The above command returns JSON structured like this:

{
    "serviceName": "name_category",
    "serviceGroup": "general",
    "costInUnits": 1
}

Software Version

GET
  • Cost: 1 credit per name.
  • Description: Returns the current version of the Namsor software.
  • More about: Software Version

HTTP request

http request
GET
https://v2.namsor.com/NamSorAPIv2/api2/json/softwareVersion
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Response
NameTypeDescription
softwareNameAndVersionStringName and version of the API.
softwareVersionArraySoftware version, as an array (major, minor and patch).

Code sample:

Software Version code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/softwareVersion \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
    "softwareVersion": [
        2,
        0,
        14
    ]
}

Software Version code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/softwareVersion")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
    "softwareVersion": [
        2,
        0,
        14
    ]
}

Software Version code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/softwareVersion"

headers = {
  "X-API-KEY": "your-api-key",
 "Accept": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

The above command returns JSON structured like this:

{
    "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
    "softwareVersion": [
        2,
        0,
        14
    ]
}

Software Version code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/softwareVersion", {
  "method": "GET",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json"
  }
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

The above command returns JSON structured like this:

{
    "softwareNameAndVersion": "NamSorAPIv2.0.14B01",
    "softwareVersion": [
        2,
        0,
        14
    ]
}

Taxonomy Classes

GET
  • Cost: 1 credit per name.
  • Description: Returns a list of the possible enumerators for a given classifier.
  • More about: Taxonomy Classes

HTTP request

http request
GET
https://v2.namsor.com/NamSorAPIv2/api2/json/taxonomyClasses/{classifierName}
Request header
PropertyRequiredDescription
X-API-KEYRequiredYour Namsor's services API key
information

To get an API key for free, please create an account.

Request parameters
NameTypeRequiredDescription
classifierNameStringRequiredName of the classifier.
Response
NameTypeDescription
classifierNameStringName of the submitted classifier.
taxonomyClassesArrayPossible enumerators for this classifier.

Code sample:

Taxonomy Classes code sample for shell:

curl --request GET \ 
--url https://v2.namsor.com/NamSorAPIv2/api2/json/taxonomyClasses/personalname_gender \
--header 'X-API-KEY: your-api-key' \
--header 'Accept: application/json'

The above command returns JSON structured like this:

{
    "classifierName": "personalname_gender",
    "taxonomyClasses": ["female", "male"]
}

Taxonomy Classes code sample for java:

HttpResponse<String> response = Unirest.get("https://v2.namsor.com/NamSorAPIv2/api2/json/taxonomyClasses/personalname_gender")
.header("X-API-KEY", "your-api-key")
.header("Accept", "application/json")
.asString();

The above command returns JSON structured like this:

{
    "classifierName": "personalname_gender",
    "taxonomyClasses": ["female", "male"]
}

Taxonomy Classes code sample for python:

import requests

url = "https://v2.namsor.com/NamSorAPIv2/api2/json/taxonomyClasses/personalname_gender"

headers = {
  "X-API-KEY": "your-api-key",
 "Accept": "application/json"
}

response = requests.request("GET", url, headers=headers)

print(response.text)

The above command returns JSON structured like this:

{
    "classifierName": "personalname_gender",
    "taxonomyClasses": ["female", "male"]
}

Taxonomy Classes code sample for javascript:

const response = await fetch("https://v2.namsor.com/NamSorAPIv2/api2/json/taxonomyClasses/personalname_gender", {
  "method": "GET",
  "headers": {
    "X-API-KEY": "your-api-key",
    "Accept": "application/json"
  }
});

if (response.ok) {
  const data = await response.json(); // Extract JSON data from response
  console.log(data); // View data in the console
} else {
  console.error("The request failed with status:", response.status, response);
}

The above command returns JSON structured like this:

{
    "classifierName": "personalname_gender",
    "taxonomyClasses": ["female", "male"]
}