Technical documentation for integrating the widget into your real estate listings
Add this snippet to your listing page template:
<!-- Piknik Local Food Score Widget -->
<div
id="piknik-food-score"
data-piknik-widget
data-api-key="YOUR_API_KEY_HERE"
data-address="[LISTING_ADDRESS]"
data-radius="8"
data-size="badge"
data-theme="light"
></div>
<script src="https://piknik.spot/widgets/piknik-widget.js" defer></script>Replace YOUR_API_KEY_HERE only if you're building manually — when you use Copy embed code in Widget Builder, your widget ID is included automatically. Replace [LISTING_ADDRESS] with your property address (or address variable).
| Attribute | Type | Default | Description |
|---|---|---|---|
data-api-key | string | required | Your widget ID — included automatically in embed code (data-api-key) |
data-address | string | required* | Full address or template variable |
data-lat | number | optional* | Latitude (if address not provided) |
data-lng | number | optional* | Longitude (if address not provided) |
data-listing-url | string | — | Optional. Agent listing page URL — shows a back link on the Piknik details page |
data-listing-title | string | — | Optional. Short label for the listing banner (defaults to address) |
data-radius | number | 8 | Search radius in kilometers (1–25). Use 1 km for walkable access; wider for rural. |
data-size | string | full | "badge" (~40px, clickable), "compact" (~60px, inline), or "full" (~400px) |
data-label | string | Food Score | Widget title (leave empty for logo + score only) |
data-theme | string | light | "light" or "dark" (choose to match your site) |
* Either data-address or both data-lat and data-lng must be provided
<div
id="piknik-food-score"
data-piknik-widget
data-api-key="pk_live_..."
data-address="<?php echo get_field('property_address'); ?>"
data-radius="8"
data-size="badge"
></div>
<script src="https://piknik.spot/widgets/piknik-widget.js" defer></script><div
id="piknik-food-score"
data-piknik-widget
data-api-key="pk_live_..."
data-address="%%address%%, %%city%%, %%state%%"
data-radius="8"
data-size="badge"
></div>
<script src="https://piknik.spot/widgets/piknik-widget.js" defer></script>IDX Broker uses %%variable%% syntax for property data
<div
id="piknik-food-score"
data-piknik-widget
data-api-key="pk_live_..."
data-address="410 Northfield Drive W, Waterloo, ON"
data-radius="8"
></div>
<script src="https://piknik.spot/widgets/piknik-widget.js" defer></script>The Local Food Score (0-100) combines three buyer-facing factors with honesty gates:
Plate-group coverage from sources you can actually reach within your search radius.
Distance to reachable farms, markets, and local-food businesses, with walkability bonuses.
Year-round plate coverage plus nutrient depth from reachable offerings (production within 100 km).
Our algorithm evaluates nutritional completeness by measuring access to essential nutrients (proteins, vitamins, minerals) from local food sources. It considers both direct access(farms, markets) and indirect access (restaurants and shops sourcing from local farms). When restaurants and shops document their local supplier relationships, those connections improve the area's score by making farm nutrients accessible through more convenient retail channels. This incentivizes transparency in local food supply chains.
Example: 410 Northfield Drive W, Waterloo, ON
Food Score87A-Demo preview — sample score for illustration
Send buyers straight to the full Local Food Score details page from your CRM, email campaigns, or internal QA tools — without embedding a widget button.
GET https://piknik.spot/local-food-score?apiKey=YOUR_WIDGET_ID&address=[LISTING_ADDRESS]&radius=8&listingUrl=[LISTING_URL]&listingTitle=[LISTING_TITLE]Requires your widget ID (apiKey). Provide address or lat + lng. Copy a ready-made template from the Widget Builder dashboard.
For custom integrations, you can call the API directly:
GET https://piknik.spot/api/local-food-scoreapiKey(required) - Your widget ID, included in embed code from Widget Builderaddress(required*) - Full address stringlat, lng(optional*) - Coordinates as alternative to addressradius(optional) - Search radius in km (default: 8){
"score": 85,
"grade": "Strong",
"summary": "Two of three plate groups are covered nearby. Sources are a short trip away.",
"breakdown": {
"how_local": { "score": 67, "tag": "Lots nearby" },
"easy_to_get": { "score": 88, "tag": "Short trip" },
"covers_diet": { "score": 72, "tag": "Strong in season" }
},
"gates": { "supply": true, "season_multiplier": 0.67 },
"access": {
"combined_total": 20,
"direct": { "farms": 12, "markets": 3, "csas": 2 },
"indirect": { "total_connected_farms": 8, "restaurants_sourcing_locally": 5 }
},
"nearest": [
{
"name": "St. Jacobs Farmers Market",
"type": "MARKET",
"access_type": "direct",
"distance_km": 2.3
},
...
]
}Our team is here to help with integration, customization, and troubleshooting.