NAV Navbar
Logo
Shell HTTP JavaScript Node.JS Python Ruby Java

NameScan API Reference v2

Welcome to the NameScan RESTful API. You can use our API to access NameScan functionalities.

The NameScan API is organised around REST. Our API has predictable, resource-oriented URLs, and uses HTTP response codes to indicate API errors. We use built-in HTTP features, such as HTTP authentication and HTTP verbs, which are understood by off-the-shelf HTTP clients. We support cross-origin resource sharing, allowing you to interact securely with our API from a client-side web application (though you should never expose your secret API key in any public website’s client-side code). JSON is returned by all API responses, including errors.

We have language bindings in cUrl, Ruby, and Python. You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

Old API References

This document is related to API 2.0. You can find old version documents if you use prevoius versions.

NameScan API Reference v1

Authentication

Authenticate your account when using the API by including your secret or test API key in the request. You can manage your API keys in your profile. Your API keys carry many privileges, so be sure to keep them secret! Do not share your secret API keys in publicly accessible areas.

NameScan API expects for the API key to be included in all API requests to the server in a header that looks like the following:

api-key: your-api-key

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Errors

NameScan uses conventional HTTP response codes to indicate the success or failure of an API request. In general, codes in the 2xx range indicate success, codes in the 4xx range indicate an error that failed given the information provided (e.g. a required parameter was omitted, etc) and codes in the 5xx range indicate an error with NameScans servers..

Error Codes

Status Description
200 - OK The request succeeded and the requested information is in the response. This is the most common status code to receive.
201 - Created The request resulted in a new resource being created before the response was sent.
204 - No Content The request has been successfully processed and the response is intentionally blank.
400 - Bad Request The request could not be understood by the server. Bad Request is sent when no other error is applicable, if the exact error is unknown or does not have its own error code.
401 - Unauthorized The requested resource requires authentication.
403 - Forbidden The server refuses to fulfill the request.
500 - Internal Server Error A generic error has occurred on the server.

In addition to the error code, the response always contains a message that describes the details of the error that occurred.

The “400 - Bad Request” response also always contains a ModelState that describes detail of incorrect or invalid sent parameter.

Emerald Scans

The emerald scan API’s allow you to manage Emerald scans (perform new person scan, perform new organisation scan, get monthly history).

New Person Emerald Scan

Code samples

# You can also use wget
curl -X post https://namescan.io/api/v2/person-scans/emerald \
     -H "api-key: your-api-key" \
     -H "content-type: application/json" \
     -d "{'first_name':'john', 'last_name':'smith', 'dob':'1970', 'list_type':'sanction' }"
POST https://namescan.io/api/v2/person-scans/emerald HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json
api-key: your-api-key
<script>
  $.ajax({
    url: 'https://namescan.io/api/v2/person-scans/emerald',
    method: 'post',
    headers: {'api-key': 'your-api-key'},
    data: {'name': 'john smith'},
    success: function(result) {
      console.log(JSON.stringify(result));
    }
  })
</script>
const request = require('node-fetch');
var data = {name: 'john smith'};
fetch('https://namescan.io/api/v2/person-scans/emerald', {
    method: 'POST',
    headers: {'api-key': 'your-api-key', 'Content-Type': 'application/json'},
    body: JSON.stringify(data)
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

result = RestClient.post 'https://namescan.io/api/v2/person-scans/emerald', ...

    # TODO

p = JSON.parse(result)
import requests

header = {'api-key': 'your-api-key', 'Content-Type': 'application/json'}
data = {'name': 'john smith'}
r = requests.post('https://namescan.io/api/v2/person-scans/emerald',
    headers = header, json = data)

print r.json()
URL obj = new URL("https://namescan.io/api/v2/person-scans/emerald");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("api-key", "your api key");
con.setRequestProperty("Content-Type", "application/json");

con.setDoInput("true");
con.setDoOutput("true");

DataOutputStream output = new DataOutputStream(con.getOutputStream());
String data = "{\"name\":\"John Smith\"}";
output.writeBytes(data);
output.flush();
output.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /api/v2/person-scans/emerald

Performs new person Emerald scan

Allows you to scan persons on Emerald lists by entering their information into the fields provided.

Parameters

Parameter In Type Required Description
param body person_scan_emerald_param true Person scan parameter, which includes person information to find. name or first_name/last_name is required. name can be full name or original script. gender can be male, female or empty. dob can be in dd/mm/yyyy or yyyy formats. list_type can be pep or sanction. leave list_type as empty to scan on all lists. use included_lists if you want to scan only over a specified sanction lists. use included_lists if you wish to scan against only specific sanction lists. If you wish to exclude particular sanction lists from your scan use excluded_lists. Only one of the two lists can have a value and their value should be a comma separated id. Eg: UN, SDN etc.... match_rate is a percentage from 1-100, which indicates how closely the name being checked matches the name on the matching watchlist profile, with 1% being not close and 100% being very close.

Body parameter

{
  "name": "string",
  "first_name": "string",
  "middle_name": "string",
  "last_name": "string",
  "gender": "string",
  "dob": "string",
  "country": "string",
  "list_type": "string"
  "included_lists": "string"
  "excluded_lists": "string"
  "match_rate": "int"
}

Responses

Status Meaning Description
201 Created person_scan_emerald_result: contains information of matched persons.
400 Bad Request Bad request
401 Unauthorized Unauthorized
403 Forbidden Forbidden
500 Internal Server Error Internal Server Error

Response structure

{
  "date": "2017-07-29T12:06:08Z",
  "scan_id": "string",
  "number_of_matches": 0,
  "persons": [
    {
      "uid": "string",
      "update_at": "string",
      "update_info": "string",
      "category": "string",
      "deceased": true,
      "deceased_date": "string",
      "name": "string",
      "title": "string",
      "first_name": "string",
      "middle_name": "string",
      "last_name": "string",
      "gender": "string",
      "original_script_name": "string",
      "sort_key_name": "string",
      "dates_of_birth": [
        {
          "date": "string",
          "note": "string"
        }
      ],
      "places_of_birth": [
        {
          "city": "string",
          "region": "string",
          "country": "string",
          "text": "string",
          "note": "string",
          "type": "string"
        }
      ],
      "reference_type": "string",
      "references": [
        {
          "name": "string",
          "since": "string",
          "to": "string",
          "id_in_list": "string"
        }
      ],
      "program": "string",
      "nationality": "string",
      "citizenship": "string",
      "address": "string",
      "addresses": [
        {
          "address1": "string",
          "address2": "string",
          "address3": "string",
          "city": "string",
          "region": "string",
          "postal_code": "string",
          "country": "string",
          "text": "string",
          "note": "string"
        }
      ],
      "places": [
        {
          "country": "string",
          "type": "string"
        }
      ],
      "other_names": [
        {
          "title": "string",
          "name": "string",
          "first_name": "string",
          "middle_name": "string",
          "last_name": "string",
          "type": "string"
        }
      ],
      "dates": [
        {
          "value": "string",
          "type": "string"
        }
      ],
      "roles": [
        {
          "title": "string",
          "category": "string",
          "since": "string",
          "to": "string",
          "type": "string"
        }
      ],
      "occupations": [
        "string"
      ],
      "father": "string",
      "mother": "string",
      "spouse": "string",
      "children": [
        "string"
      ],
      "siblings": [
        "string"
      ],
      "identities": [
        {
          "number": "string",
          "country": "string",
          "note": "string",
          "type": "string"
        }
      ],
      "contacts": [
        {
          "value": "string",
          "type": "string"
        }
      ],
      "images": [
        "string"
      ],
      "links": [
        {
          "url": "string",
          "type": "string"
        }
      ],
      "sources": [
        "string"
      ],
      "basis": "string",
      "summary": "string",
      "match_rate": 0
    }
  ]
}

New Organisation Emerald Scans

Code samples

# You can also use wget
curl -X post https://namescan.io/api/v2/organisation-scans/emerald \
     -H "api-key: your-api-key" \
     -H "content-type: application/json" \
     -d "{'name':'al-shabab' }"
POST https://namescan.io/api/v2/organisation-scans/emerald HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json
api-key: your-api-key
<script>
  $.ajax({
    url: 'https://namescan.io/api/v2/organisation-scans/emerald',
    method: 'post',
    headers: {'api-key': 'your-api-key'},
    data: {'name': 'al-shabab'},
    success: function(result) {
      console.log(JSON.stringify(result));
    }
  })
</script>
const request = require('node-fetch');
var data = {name: 'al-shabab'};
fetch('https://namescan.io/api/v2/organisation-scans/emerald', {
    method: 'POST',
    headers: {'api-key': 'your-api-key', 'Content-Type': 'application/json'},
    body: JSON.stringify(data)
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

result = RestClient.post 'https://namescan.io/api/v2/organisation-scans/emerald', ...

    # TODO

p = JSON.parse(result)
import requests

header = {'api-key': 'your-api-key', 'Content-Type': 'application/json'}
data = {'name': 'al-shabab'}
r = requests.post('https://namescan.io/api/v2/organisation-scans/emerald',
    headers = header, json = data)

print r.json()
URL obj = new URL("https://namescan.io/api/v2/organisation-scans/emerald");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("POST");
con.setRequestProperty("api-key", "your api key");
con.setRequestProperty("Content-Type", "application/json");

con.setDoInput("true");
con.setDoOutput("true");

DataOutputStream output = new DataOutputStream(con.getOutputStream());
String data = "{\"name\":\"al-shabab\"}";
output.writeBytes(data);
output.flush();
output.close();

int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

POST /api/v2/organisation-scans/emerald

Performs new organisation Emerald scan

Allows you to scan organisations on Emerald lists by entering their information into the fields provided.

Parameters

Parameter In Type Required Description
param body organisation_scan_emerald_param true Organisation scan parameter, which includes organisation information to find. name is required and can be original script. use included_lists if you want to scan only over a specified sanction lists. use included_lists if you wish to scan against only specific sanction lists. If you wish to exclude particular sanction lists from your scan use excluded_lists. Only one of the two lists can have a value and their value should be a comma separated id. Eg: UN, SDN etc.... match_rate is a percentage from 1-100, which indicates how closely the name being checked matches the name on the matching watchlist profile, with 1% being not close and 100% being very close.

Body parameter

{
  "name": "string",
  "country": "string",
  "included_lists": "string"
  "excluded_lists": "string"
  "match_rate": "int"
}

Responses

Status Meaning Description
201 Created organisation_scan_emerald_result: contains information of matched organisations.
400 Bad Request Bad request
401 Unauthorized Unauthorized
403 Forbidden Forbidden
500 Internal Server Error Internal Server Error

Response structure

{
  "date": "2017-07-29T12:06:08Z",
  "scan_id": "string",
  "number_of_matches": 0,
  "organisations": [
    {
      "uid": "string",
      "update_at": "string",
      "update_info": "string",
      "category": "string",
      "ceased": true,
      "ceased_date": "string",
      "name": "string",
      "original_script_name": "string",
      "sort_key_name": "string",
      "reference_type": "string",
      "references": [
        {
          "name": "string",
          "since": "string",
          "to": "string",
          "id_in_list": "string"
        }
      ],
      "program": "string",
      "address": "string",
      "addresses": [
        {
          "address1": "string",
          "address2": "string",
          "address3": "string",
          "city": "string",
          "region": "string",
          "postal_code": "string",
          "country": "string",
          "text": "string",
          "note": "string"
        }
      ],
      "other_names": [
        {
          "name": "string",
          "type": "string"
        }
      ],
      "dates": [
        {
          "value": "string",
          "type": "string"
        }
      ],
      "identities": [
        {
          "number": "string",
          "country": "string",
          "note": "string",
          "type": "string"
        }
      ],
      "contacts": [
        {
          "value": "string",
          "type": "string"
        }
      ],
      "images": [
        "string"
      ],
      "links": [
        {
          "url": "string",
          "type": "string"
        }
      ],
      "sources": [
        "string"
      ],
      "basis": "string",
      "summary": "string",
      "match_rate": 0
    }
  ]
}

Emerald Scan History

Code samples

# You can also use wget
curl -X get https://namescan.io/api/v2/scans/emerald/{year}/{month} \
     -H "api-key: your-api-key"
GET https://namescan.io/api/v2/scans/emerald/{year}/{month} HTTP/1.1
Host: localhost
Accept: application/zip
api-key: your-api-key
<script>
  $.ajax({
    url: 'https://namescan.io/api/v2/scans/emerald/{year}/{month}',
    method: 'get',
    xhrFields: {'responseType': 'blob'},
    headers: {'api-key': 'your-api-key'},
    success: function(response, status, request) {
	  var disposition = request.getResponseHeader('Content-Disposition');
	  var filename = disposition.split(';')[1].split('=')[1];
	  var blob = Blob([response], { type: 'application/zip' });
	  var link = document.createElement('a');
	  link.href = window.URL.createObjectURL(blob);
	  link.download = filename;
	  document.body.appendChild(link);
	  link.click();
	  document.body.removeChild(link);
    }
  })
</script>
const request = require('node-fetch');
fetch('https://namescan.io/api/v2/scans/emerald/{year}/{month}', {
    method: 'GET',
    headers: {'api-key': 'your-api-key'}
})
.then(function(res) {
    // save blob...
}).
require 'rest-client'

result = RestClient.get 'https://namescan.io/api/v2/scans/emerald/{year}/{month}', ...

    # TODO

import requests

header = {'api-key': 'your-api-key', 'Content-Type': 'application/json'}
response = requests.get('https://namescan.io/api/v2/scans/emerald/{year}/{month}',
			  headers = header, stream = true)

if response.status_code == 200 : 
    if response.headers.get('Content-Disposition'):
        filename = response.headers.get('Content-disposition').split("=")[1]
        open(filename, 'wb').write(response.content)
        print('File successfully downlowded.')
else:    
    print('Error downloading file.')
	
URL obj = new URL("https://namescan.io/api/v2/scans/emerald/{year}/{month}");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("api-key", "your api key");

int responseCode = con.getResponseCode();

Map<String, List<String>> map = con.getHeaderFields();
String[] parts = map.get("Content-Disposition").toString().split("="); 
String fileName = parts[1].substring(0, parts[1].length() - 1);

Files.copy(con.getInputStream(), Paths.get(fileName), StandardCopyOption.REPLACE_EXISTING);

GET /api/v2/scans/emerald/{year}/{month}

Retrieve Emerald scans history

Allows you to retrieve monthly Emerald scan history zip file that includes json files.

Parameters

Parameter In Type Required Description
year query integer true Scan history year.
month query integer true/td> Scan history month.

Responses

Status Meaning Description
200 OK Contains content of a zip file that includes Emerald scan history in json files.
400 Bad Request Bad request
401 Unauthorized Unauthorized
403 Forbidden Forbidden
500 Internal Server Error Internal Server Error

Response structure


  Content of a zip file that includes Emerald scan history in json files.
  The file name can be retrieved from Content-Disposition header.

Lists Information

Get Sanction Lists Information

Code samples

# You can also use wget
curl -X get https://namescan.io/api/v2/lists/sanctions \
     -H "api-key: your-api-key"
GET https://namescan.io/api/v2/lists/sanctions HTTP/1.1
Host: localhost
Content-Type: application/json
Accept: application/json
api-key: your-api-key
<script>
  $.ajax({
    url: 'https://namescan.io/api/v2/lists/sanctions',
    method: 'get',
    headers: {'api-key': 'your-api-key'},
    success: function(data) {
      console.log(JSON.stringify(data));
    }
  })
</script>
const request = require('node-fetch');
fetch('https://namescan.io/api/v2/lists/sanctions', { 
    method: 'GET',
    headers: {'api-key': 'your-api-key'}
})
.then(function(res) {
    return res.json();
}).then(function(body) {
    console.log(body);
});
require 'rest-client'
require 'json'

result = RestClient.get 'https://namescan.io/api/v2/lists/sanctions', ...

    # TODO

p = JSON.parse(result)
import requests

header = {'api-key': 'your-api-key'}
param = {'scan_id': 'your-scan-id'}
r = requests.get('https://namescan.io/api/v2/lists/sanctions',
    headers = header, params = param)

print r.json()
URL obj = new URL("https://namescan.io/api/v2/lists/sanctions");
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setRequestMethod("GET");
con.setRequestProperty("api-key", "your api key");
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(
    new InputStreamReader(con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
    response.append(inputLine);
}
in.close();
System.out.println(response.toString());

GET /api/v2/lists/sanctions

Retrieve sanction lists information

Allows you to retrieve information of sanction lists. The list ID can be used on the included or the excluded list parameter of a person or organisation scan

Responses

Status Meaning Description
200 OK list_info: contains id and name of sanction list.
400 Bad Request Bad request
401 Unauthorized Unauthorized
403 Forbidden Forbidden
500 Internal Server Error Internal Server Error

Response structure

[
  {
    "id": "string",
    "name": "string"
  }
]