Widget & API Documentation
Embed the AI Job Risk Checker on your site or integrate our data API directly into your applications.
iFrame Embed
The simplest way to embed the widget. Paste the HTML into any page or CMS.
<iframe src="https://aireplacedmyjob.com/widget/risk?job=accountant&theme=light&source=yourblog.com" width="400" height="280" frameborder="0" style="border-radius: 4px; border: 1px solid #e5e7eb; display: block;" ></iframe>
Query parameters:
Recommended sizes: 300×200 (compact), 400×280 (standard), 500×350 (large)
Live example:
Script Tag Embed
Prefer a script tag? Add a data-aireplaced-widget attribute to any div, then include our loader script.
<!-- Widget container --> <div data-aireplaced-widget data-job="accountant" data-theme="light" data-width="400" data-height="280" ></div> <!-- Loader (once per page, before </body>) --> <script src="https://aireplacedmyjob.com/widget.js"></script>
Data attributes:
REST API
Query our risk database directly for use in your own UI or backend. No API key required.
/api/widget/risk?job=JOBTITLEReturns AI displacement risk data for the given job title.
Example request:
curl "https://aireplacedmyjob.com/api/widget/risk?job=accountant"
Response — job found:
{
"found": true,
"jobTitle": "Accountant",
"riskScore": 82,
"riskLevel": "CRITICAL",
"timeline": "1-3 years",
"slug": "accountant"
}Response — job not found (fallback):
{
"found": false,
"jobTitle": "Underwater Welder",
"riskScore": 65,
"riskLevel": "MODERATE",
"timeline": "3-5 years",
"slug": null
}Response fields:
CORS & Rate Limits
Allowed from any origin (Access-Control-Allow-Origin: *). No preflight required for GET requests.
1,000 requests per hour per IP. Cached responses count once per 5 minutes per job title.
Code Examples
React / Next.js
import { useEffect, useState } from 'react';
function RiskBadge({ job }: { job: string }) {
const [data, setData] = useState<any>(null);
useEffect(() => {
fetch(`https://aireplacedmyjob.com/api/widget/risk?job=${encodeURIComponent(job)}`)
.then(r => r.json())
.then(setData);
}, [job]);
if (!data) return <span>Loading...</span>;
return (
<div>
<strong>{data.jobTitle}</strong>: {data.riskScore}% — {data.riskLevel}
<br />
<a href={`https://aireplacedmyjob.com/assessment?job=${job}`}>
Full report →
</a>
</div>
);
}Vanilla JavaScript
fetch('https://aireplacedmyjob.com/api/widget/risk?job=accountant')
.then(res => res.json())
.then(data => {
console.log(data.jobTitle, data.riskScore + '%', data.riskLevel);
// "Accountant" 82% CRITICAL
});WordPress (PHP)
<?php
// In your theme template or plugin
$job = get_query_var('job_title', 'accountant');
$url = 'https://aireplacedmyjob.com/api/widget/risk?job=' . urlencode($job);
// Option 1: iframe
echo '<iframe src="https://aireplacedmyjob.com/widget/risk?job=' . esc_attr($job) . '&theme=light" width="400" height="280" frameborder="0"></iframe>';
// Option 2: server-side data fetch
$response = wp_remote_get($url);
$data = json_decode(wp_remote_retrieve_body($response), true);
echo '<p>' . esc_html($data['jobTitle']) . ': ' . $data['riskScore'] . '% ' . esc_html($data['riskLevel']) . '</p>';Attribution Requirements
Required Attribution
All embeds must display the “Powered by aireplacedmyjob.com” attribution that is included by default in the widget. You must not hide, obscure, or remove this attribution. The widget may not be used to misrepresent the source of the data. See our full Terms of Service.