BREAKINGJust laid off? Your 48-hour action checklist → Start here
Developer Docs

Widget & API Documentation

Embed the AI Job Risk Checker on your site or integrate our data API directly into your applications.

iFrame EmbedScript TagREST APICORS & Rate LimitsCode ExamplesAttribution

iFrame Embed

The simplest way to embed the widget. Paste the HTML into any page or CMS.

html
<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:

ParameterTypeRequiredDescription
jobstringNoPre-fills the job title input
themestringNo"light" (default) or "dark"
sourcestringNoYour domain — used for analytics tracking

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.

html
<!-- 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:

AttributeDefaultDescription
data-job""Pre-fill job title
data-themelight"light" or "dark"
data-width400iFrame width in px
data-height280iFrame height in px

REST API

Query our risk database directly for use in your own UI or backend. No API key required.

GET/api/widget/risk?job=JOBTITLE

Returns AI displacement risk data for the given job title.

Example request:

bash
curl "https://aireplacedmyjob.com/api/widget/risk?job=accountant"

Response — job found:

json
{
  "found": true,
  "jobTitle": "Accountant",
  "riskScore": 82,
  "riskLevel": "CRITICAL",
  "timeline": "1-3 years",
  "slug": "accountant"
}

Response — job not found (fallback):

json
{
  "found": false,
  "jobTitle": "Underwater Welder",
  "riskScore": 65,
  "riskLevel": "MODERATE",
  "timeline": "3-5 years",
  "slug": null
}

Response fields:

FieldTypeDescription
foundbooleanWhether the job was found in our database
jobTitlestringNormalized job title (as stored or as queried)
riskScorenumberAI displacement score 0–100
riskLevelstringCRITICAL / HIGH / MODERATE / LOW
timelinestringEstimated displacement timeline
slugstring | nullURL slug for the full report, or null if not found

CORS & Rate Limits

CORS

Allowed from any origin (Access-Control-Allow-Origin: *). No preflight required for GET requests.

Rate Limit

1,000 requests per hour per IP. Cached responses count once per 5 minutes per job title.

Code Examples

React / Next.js

tsx
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

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
<?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.

Get Your Embed Code →