Embed API
Add AI-powered turf visualization and instant quoting to any website in two lines of code.
When a homeowner uses the widget on your site, their lead — including the AI visualization and sqft estimate — lands directly in your Instant Turf Quote dashboard.
How It Works
Quickstart (2 Lines)
Paste this into any HTML page, replacing YOUR_API_KEY with your key from the dashboard.
<div id="itq-widget" data-api-key="YOUR_API_KEY"></div>
<script src="https://instantturfquote.com/embed.js"></script>
This renders a "Get a Free Instant Quote" button wherever the <div> is placed.
Authentication
All embed API requests must include your API key. You can send it as:
- HTTP Header:
X-API-Key: itq_live_... - Query param:
?api_key=itq_live_...
API Reference
Base URL: https://instantturfquote.com
Query Parameters
| Param | Description |
|---|---|
| api_key required | Your embed API key |
Response
{
"company_name": "Bob's Turf Co.",
"color_scheme": "emerald",
"rep_name": "Bob Smith"
}Accepts multipart/form-data. This is the heavy lifting — AI visualization typically takes 15–30 seconds.
Request Fields
| Field | Type | Description |
|---|---|---|
| file required | File | Lawn photo. JPG, PNG, or WebP. Max 20 MB. |
| texture optional | string | natural (default), premium, or sport |
| yard_type optional | string | Hint for AI: front yard, backyard, pet area, etc. |
Headers
| Header | Value |
|---|---|
| X-API-Key required | Your embed API key |
Response
{
"status": "success",
"original_image": "<base64 JPEG>",
"result_image": "<base64 JPEG>",
"sqft": 842,
"lawn_percentage": 68.4,
"quote": {
"price_low": 8400,
"price_high": 11800,
"sqft": 842
}
}Accepts application/json. The lead is assigned directly to your account.
Request Body
| Field | Type | Description |
|---|---|---|
| name required | string | Homeowner's full name |
| email required | string | Homeowner's email |
| zip_code required | string | US zip code |
| phone optional | string | Homeowner's phone number |
| sqft_estimate optional | number | Estimated square footage from visualize step |
| result_image optional | string | Base64 turf visualization image |
| original_image optional | string | Base64 original photo |
Response
{
"status": "success",
"lead_id": "a1b2c3...",
"message": "Thanks Jane! Bob's Turf Co. will be in touch shortly."
}Widget Installation
The drop-in widget handles the full flow automatically — upload, AI processing, before/after slider, and lead capture. No configuration required beyond your API key.
Options (data attributes)
| Attribute | Default | Description |
|---|---|---|
| data-api-key | required | Your embed API key |
| data-button-text | "Get a Free Instant Quote" | Text shown on the trigger button |
| data-host | https://instantturfquote.com | Override the API host (advanced) |
Examples
Inline button inside a section:
<section class="cta-section">
<h2>Get a Free Instant Quote</h2>
<div id="itq-widget" data-api-key="itq_live_..." data-button-text="Visualize My Lawn →"></div>
</section>
<script src="https://instantturfquote.com/embed.js"></script>
Floating button (no div needed):
<script src="https://instantturfquote.com/embed.js"
data-api-key="itq_live_..."
data-button-text="Get a Free Quote">
</script>
When no #itq-widget div exists, the widget injects a floating button in the bottom-right corner of the page.
Managing API Keys
Generate and manage your API keys from your dashboard → API & Embed tab.
- Each account can have up to 5 active keys
- Keys can be named (e.g. "Main Website", "Landing Page")
- Delete a key instantly to revoke access
- Usage stats (request count, last used) shown per key
FAQ
Does the homeowner know they're using Instant Turf Quote?
No. The widget shows your company name and branding. "Instant Turf Quote" only appears in a small "Powered by" footer inside the modal.
Where do leads go?
Directly into your Instant Turf Quote dashboard under the Leads tab. They are private to your account and are never shared with other reps or added to the lead marketplace.
Is there an extra charge for the embed API?
No — it's included in all paid plans (Individual and Executive). Every visualization uses AI credits from your plan.
What if the AI visualization fails?
The widget shows a friendly error with a "Try Again" option. The lead is only submitted after the homeowner fills in their contact info — a failed visualization simply means they don't proceed to that step.
Can I use the API directly without the widget?
Yes. The three endpoints are fully documented above and can be called from any frontend or backend. The widget is just a convenience wrapper.
Do I need to set up CORS on my server?
No. The embed endpoints on our server are CORS-open, so the widget can call them from any domain. Your web server doesn't need any changes.