API
Listcleaner API Documentation
Our Email list cleaning API is easy to use and integrates within any software language.
Here you can find our email list cleaning API documentation, with ready made Node.js examples.
Getting started
Click here to go to your dashboard.
Every request to our List Cleaning API requires these header parameters:
X-User-Email string
X-Api-Key string
Depending on the API call other query parameters are:
uid string This uid is the identifier of an uploaded data file.
file string($binary) The comma separated CSV file to be uploaded
mapping string The column name of your CSV file containing the email adresses
reference string Reference for your datafile
export_type string Choose options: all, ok, bad, for the requested dataset download.
Every response from our List Cleaning API come with a response code
200 Success
401 Unauthorized (check your username and API key)
400 Missing UID or other request error (check if the UID is in the request)
404 File not found (File not found or not ready for download)
404 File not found (File not found or not ready for download)
Listcleaner API - Node.js Examples
Listcleaner API - Node.js examples
Node.js
/get_credits
Retrieve the amount of available credits
Request:
const axios = require('axios');
const options = {
method: 'GET',
url: 'https://api.listcleaner.net/get_credits',
headers: {
'accept': 'application/json',
'X-User-Email': 'username@domain.com',
'X-Api-Key': 'YOUR_API_KEY'
}
};
axios.request(options).then(response => {
console.log(response.data); // Output user credits
}).catch(error => {
console.error(`Error: ${error.response.status}`); // Handle errors
});
Response (code 200):
{
"credits": 0
}
Node.js
/upload_list
Upload your email data file to be cleaned
Request:
const axios = require('axios');
const FormData = require('form-data');
const fs = require('fs');
const url = 'https://api.listcleaner.net/upload_list';
const form = new FormData();
form.append('file', fs.createReadStream('YOUR_FILENAME.csv'), { filename: 'YOUR_FILENAME.csv', contentType: 'text/csv' });
form.append('mapping', 'YOUR_MAPPING_COLUMN');
form.append('reference', 'YOUR_REFERENCE');
axios.post(url, form, {
headers: {
...form.getHeaders(),
'accept': 'application/json',
'X-User-Email': 'username@domain.com',
'X-Api-Key': 'YOUR_API_KEY'
}
})
.then(response => {
console.log(response.data); // Output the response
})
.catch(error => {
console.error(`Error: ${error.response.status}`);
});
Response (code 200):
{
"status": "File uploaded successfully",
"uid": "d53dec-bac2b5-34dfd1",
"records_total": 28391
}
Node.js
/show_lists
Have a look at all your lists
?uid is optional and will only show that specific list.
Request:
const axios = require('axios');
// Optional uid parameter
const uid = "abc123-def456-ghi789";
const url = `https://api.listcleaner.net/show_lists?uid=${uid}`;
axios.get(url, {
headers: {
'accept': 'application/json',
'X-User-Email': 'username@domain.com',
'X-Api-Key': 'YOUR_API_KEY'
}
})
.then(response => {
console.log(response.data); // Output the response
})
.catch(error => {
console.error(`Error: ${error.response.status}`);
});
Response (code 200):
{
"lists": [
{
"uid": "abc123-def456-ghi789",
"created": "2024-01-01 00:00:01",
"filename_original": "dummy.csv",
"reference": "Dummy File Upload",
"mapping": "emailaddress",
"records_total": 436,
"records_processed": "436",
"records_ok": "405",
"records_bad": "31",
"records_bad_breakdown": "{\"catch_all\": 2, \"blacklisted_email\": 1, \"spamtrap\": 1, \"account_inactive\": 4, \"syntax_error\": 1, \"mx_server_offline\": 1, \"invalid_mx\": 3, \"disposable_domain\": 16, \"mx_server_error\": 2}",
"paid": "paid",
"current_step": "done",
"current_status": "done",
"last_status_update": "2024-01-01 00:01:02"
}
]
}
Node.js
/download_list
Download your cleaned lists, when its current_status is "done".
Options:
all -> Export of all the data
ok -> Export of the clean data
bad -> Export of the bad data
The statuses can be found in the "reason" column.
(We use "abc123-def456-ghi789" as example uid.)
Request:
const axios = require('axios');
const fs = require('fs');
// Parameters
const uid = "abc123-def456-ghi789";
const exportType = "all";
const url = `https://api.listcleaner.net/download_list?uid=${uid}&export_type=${exportType}`;
axios.get(url, {
headers: {
'accept': '*/*',
'X-User-Email': 'username@domain.com',
'X-Api-Key': 'YOUR_API_KEY',
},
responseType: 'arraybuffer' // for binary data
})
.then(response => {
// Save the response data to a file
fs.writeFileSync('downloaded_list.csv', response.data);
console.log("List downloaded successfully.");
})
.catch(error => {
console.error(`Error: ${error.response.status}`);
});
Node.js
/delete_list
Remove your list from the panel
Request:
const axios = require('axios');
// Parameters
const uid = "abc123-def456-ghi789";
const url = `https://api.listcleaner.net/delete_list?uid=${uid}`;
axios.post(url, null, {
headers: {
'accept': '*/*',
'X-User-Email': 'username@domain.com',
'X-Api-Key': 'YOUR_API_KEY',
}
})
.then(response => {
console.log(response.data); // Output the response
})
.catch(error => {
console.error(`Error: ${error.response.status}`);
});
Response (code 200):
{
"status": "List removed successfully"
}