API Test Lab
Test SmartLocator Single and Bulk APIs, inspect responses, compare Ready and Manual downloads, and collect evidence for client issues.
Quick start
Configure your API key, then choose a test.
Recent activity
This browser session only.
Testing capabilities
Raw response, HTTP status, duration.
Upload, poll status and inspect counts.
Independent CSV download and preview.
Independent CSV download and preview.
Connection settings
Use your existing SmartLocator account. Your API key is encrypted and saved server-side.
SmartLocator API key
Single API testing
Send one address and inspect the complete response from the existing endpoint.
Request builder
Address required; customer name optional.
Response inspector
Run a test to inspect the response.
Bulk API testing
Upload a small CSV or Excel file, track the job, and test Ready and Manual downloads independently.
1. Submit a test file
CSV, XLSX or XLS · current API limit 2,000 rows.
2. Job status
No job selected.
— Not started3. Ready output
Download the CSV file. Address and order rows are not displayed in this dashboard.
4. Manual output
Download the CSV file. Address and order rows are not displayed in this dashboard.
Job history
Only API-submitted jobs are shown. Website uploads and Shopify dashboard jobs are excluded. Filter by status or search a filename.
Activity Logs
View recent Test Lab activity and request outcomes.
Last 24 hours
Newest first · up to 200 events · refreshes automatically every 30 seconds while this tab is open.
Privacy: activity logs contain event metadata only. Address values, CSV rows, order details, API keys, tokens and raw request/response bodies are not stored here. Only your authenticated account's events are returned.
Docs & Integration Examples
Copy practical starter code for your own backend, Google Sheets, bulk workflows and customer-facing dashboards. Examples use placeholders; keep real API keys on trusted server-side systems.
Before you start
- Base URL:
https://smartlocator.online - Authentication:
Authorization: Bearer YOUR_API_KEY - Single verification:
POST /api/single-verify - Bulk jobs:
POST /api/bulk-jobs, then check status and download results. - Single API requires an address of at least five words.
- Bulk CSV uploads support up to 2,000 data rows per job.
Choose a recipe
Each example is a starting point to adapt and test against your account and API plan.
1. Single address verification
Run this from a trusted server or terminal. The request fields match the official API reference.
cURL
curl -X POST "https://smartlocator.online/api/single-verify" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"address": "Flat 204, Green Park Apartments, Sector 45, Gurugram, Haryana 122003",
"customerName": "Ravi Kumar"
}'Node.js (server-side)
const response = await fetch("https://smartlocator.online/api/single-verify", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.SMARTLOCATOR_API_KEY}`,
"Content-Type": "application/json"
},
body: JSON.stringify({
address: "Flat 204, Green Park Apartments, Sector 45, Gurugram, Haryana 122003",
customerName: "Ravi Kumar"
})
});
const raw = await response.text();
let result;
try { result = JSON.parse(raw); } catch { result = { message: raw }; }
if (!response.ok) {
const detail = result.message || result.error || result.detail ||
`HTTP ${response.status}`;
throw new Error(`SmartLocator request failed: ${detail}`);
}
console.log(result);Handle the actual JSON fields returned by your account's response; avoid assuming fields not present in the response.
2. Google Sheets with Apps Script
Example: read an address from column A and write the HTTP status plus result JSON into columns B and C. Set a script property named SMARTLOCATOR_API_KEY under Apps Script project settings before running.
function verifySelectedAddress() {
const apiKey = PropertiesService.getScriptProperties()
.getProperty('SMARTLOCATOR_API_KEY');
if (!apiKey) throw new Error('Set SMARTLOCATOR_API_KEY in Script Properties.');
const sheet = SpreadsheetApp.getActiveSheet();
const row = sheet.getActiveCell().getRow();
if (row < 2) throw new Error('Select an address row below the header.');
const address = String(sheet.getRange(row, 1).getDisplayValue()).trim();
if (!address) throw new Error('Column A has no address.');
const response = UrlFetchApp.fetch(
'https://smartlocator.online/api/single-verify',
{
method: 'post',
contentType: 'application/json',
headers: { Authorization: 'Bearer ' + apiKey },
payload: JSON.stringify({ address: address }),
muteHttpExceptions: true
}
);
const status = response.getResponseCode();
const body = response.getContentText();
let parsed;
try { parsed = JSON.parse(body); } catch (e) { parsed = null; }
sheet.getRange(row, 2).setValue(status);
// Preserve the upstream error message when available; otherwise keep the body.
const display = status >= 200 && status < 300
? (parsed ? JSON.stringify(parsed) : body)
: ((parsed && (parsed.message || parsed.error || parsed.detail)) ||
body || ('Request failed with HTTP ' + status));
sheet.getRange(row, 3).setValue(String(display).slice(0, 45000));
}This one-row helper is a starter example, not a high-volume batch runner. Add backoff, quotas and retry handling before processing large sheets.
3. Build your own customer dashboard
Recommended architecture: browser UI → your own backend endpoint → SmartLocator API. Your backend stores the secret key and returns only the result your UI needs.
Browser-side UI (calls your backend, not SmartLocator directly)
async function verifyAddress() {
const address = document.querySelector('#address').value.trim();
const button = document.querySelector('#verify');
const output = document.querySelector('#result');
if (!address) { output.textContent = 'Enter an address.'; return; }
button.disabled = true;
output.textContent = 'Verifying…';
try {
// This is YOUR backend route, which securely calls SmartLocator.
const response = await fetch('/api/verify-address', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ address })
});
const result = await response.json();
if (!response.ok) throw new Error(result.message || 'Verification failed');
output.textContent = JSON.stringify(result, null, 2);
} catch (error) {
output.textContent = error.message || 'Unable to verify address.';
} finally {
button.disabled = false;
}
}The /api/verify-address route is an example you must implement on your own server. Do not deploy this UI alone and expect the placeholder route to exist.
4. Bulk CSV workflow
Bulk processing is asynchronous. Submit the CSV from your backend, persist the returned job ID, poll with a reasonable interval, stop when terminal, then download the output.
const base = 'https://smartlocator.online';
const headers = {
Authorization: `Bearer ${process.env.SMARTLOCATOR_API_KEY}`,
'Content-Type': 'application/json'
};
const submit = await fetch(base + '/api/bulk-jobs', {
method: 'POST',
headers,
body: JSON.stringify({
filename: 'orders.csv',
totalRows: 1,
csvData: 'ORDER ID,CUSTOMER NAME,CUSTOMER RAW ADDRESS\\n1001,Ravi Kumar,DLF Phase 1 Gurgaon 122002'
})
});
const submitText = await submit.text();
let created;
try { created = JSON.parse(submitText); } catch { created = { message: submitText }; }
if (!submit.ok || !created.jobId) {
const detail = created.message || created.error || created.detail ||
`HTTP ${submit.status}`;
throw new Error(`Bulk submission failed: ${detail}`);
}
const jobId = created.jobId;
// Poll no faster than every 5–10 seconds; use a sensible overall timeout.
let job;
for (let attempt = 0; attempt < 60; attempt++) {
await new Promise(resolve => setTimeout(resolve, 5000));
const statusResponse = await fetch(base + '/api/bulk-jobs', {
headers: { Authorization: headers.Authorization }
});
const statusData = await statusResponse.json();
if (!statusResponse.ok) throw new Error('Could not load jobs');
job = (statusData.jobs || []).find(item => String(item._id) === String(jobId));
if (!job) throw new Error('Job not found for this account');
if (['Completed', 'Failed', 'Cancelled'].includes(job.status)) break;
}
if (!job || job.status !== 'Completed') {
throw new Error('Job did not complete successfully within the example timeout');
}
const ready = await fetch(
base + '/api/bulk-jobs?action=download&jobId=' +
encodeURIComponent(jobId) + '&type=ready',
{ headers: { Authorization: headers.Authorization } }
);
if (!ready.ok) {
const detail = await ready.text();
throw new Error('Ready CSV download failed: ' + (detail || `HTTP ${ready.status}`));
}
const readyCsv = await ready.text();
console.log('Ready CSV characters:', readyCsv.length);
// To download Manual output instead, use type=manual in the same URL.
// Check the job's terminal status before requesting either output.Confirm the actual job response fields and available download types in the official reference. Respect account plan limits and do not retry job submission blindly after an uncertain network timeout.
5. Errors and troubleshooting
Read the HTTP status and the API response body together. The examples below describe common situations; exact status codes and wording can depend on the endpoint and account state. Prefer the actual message or error returned by SmartLocator over a hard-coded assumption.
| Situation | What it means | What to do |
|---|---|---|
| 401 / authentication | The key may be missing, invalid, or associated with another account. | Check the Bearer header, replace the key if needed, and confirm you are using the intended account. |
| 400 / validation | A required field, request format, address, or upload may be invalid. | Read the returned message; check JSON, required fields, the CSV header, and the address requirements. |
| Insufficient credits | The account has fewer credits than the job requires. For example, the Test Lab may display: “You have 1000 credits but require 1,396.” | Check your balance and estimated job cost. Add credits or reduce the upload, then submit again only after resolving the issue. |
| Upload exceeds 2,000 rows | The current bulk upload limit is 2,000 data rows per job. | Split the file into smaller uploads of at most 2,000 data rows each. A CSV header is not a data row. |
| Another bulk job is active | The account may be limited to one active bulk job at a time. | Check job history and wait for the existing job to reach a terminal status before starting another. |
| 429 / rate limit | Requests are arriving too quickly or a service limit has been reached. | Reduce request frequency and use bounded exponential backoff with jitter for retryable requests. |
| 5xx / timeout / network error | The service or network may have failed before the client received a response. | Use bounded retries where safe. For bulk submission, check job history before retrying: the first request may have created a job even if its response was lost. |
| Job not found | The job ID may be wrong or the request may be using a different account. | Use the job ID returned at submission and check it under the same authenticated account. |
| Ready or Manual download unavailable | The job may still be running, failed, or cancelled; the requested output may not be available. | Check job status first. Download ready or manual only when the job has completed successfully. |
Example: show the API's actual error message (Node.js)
const response = await fetch(url, options);
const raw = await response.text();
let data;
try { data = JSON.parse(raw); } catch { data = { message: raw }; }
if (!response.ok) {
const message = data.message || data.error || data.detail ||
`Request failed with HTTP ${response.status}`;
throw new Error(message);
}
This is a general response-handling pattern, not a promise that every endpoint uses the same error fields. Do not log API keys, addresses, CSV contents, or other sensitive request data when reporting errors.
Diagnostics
See error details returned by each request, available technical information, and a suggested next step. Suggested actions are shown only when supported by the available details.
Generate a report after running tests.