Integration Guide

British Airfields Website Integration

Add live schedules, embedded forms, and live weather data to your airfield website in minutes.

This guide explains how to integrate British Airfields features directly into your airfield's own website. All features are provided free of charge and require only a few lines of HTML. No programming experience is necessary.

Each integration listed below is independent — you can add one, some, or all of them. For each feature, simply copy the code snippet and paste it into the page on your website where you want it to appear.

Before you begin

  • Your airfield must be listed on britishairfields.com
  • You will need your airfield's slug — this is a lowercase, hyphenated version of your airfield name (e.g. sutton-meadows). Contact us if you are unsure.
  • For weather integration, your airfield must have a compatible weather station. Contact us for supported types.
1

Inbound PPR Schedule

Show pilots who are booked to fly in to your airfield

The inbound schedule displays all confirmed PPR bookings for your airfield, updated in real time. Pilots visiting your website can see who else is expected and when — reducing radio congestion and improving situational awareness.

Choose where on your page you want the schedule to appear and add a <div> with a unique id.

Add the British Airfields widget script — this only needs to be added once per page even if you use multiple features.

Call showInbound() with your airfield slug, the element id, and your preferred options.

index.htmlHTML
<!-- 1. Add a container where the schedule will appear -->
<div id="arrivals"></div>

<!-- 2. Load the British Airfields widget script -->
<script src="https://britishairfields.com/api/inbound.js"></script>

<!-- 3. Initialise with your airfield slug -->
<script>
  BritishAirfields.showInbound(
    'your-airfield-slug',  // replace with your slug
    'arrivals',           // must match the div id above
    { days: 7, theme: 'light' }   // show 7 days, light theme
  )
</script>

Options: days — number of days to show (1–14, default 1)  ·  theme — 'light' or 'dark'

✅

The schedule will display automatically and update whenever new PPR bookings are made. No refresh required.

2

Outbound Traffic Schedule

Display planned departures from your airfield

The outbound schedule shows aircraft that have booked out from your airfield, giving a live picture of daily traffic in both directions. It draws from both manual book-out entries and any scraped schedule data.

index.htmlHTML
<!-- 1. Add a container -->
<div id="departures"></div>

<!-- 2. Load the widget script (skip if already added for inbound) -->
<script src="https://britishairfields.com/api/bookout.js"></script>

<!-- 3. Initialise -->
<script>
  BritishAirfields.showBookout(
    'your-airfield-slug',
    'departures',
    { days: 7, theme: 'light' }
  )
</script>
✅

Both inbound and outbound widgets can be used on the same page. The widget scripts are independent — load both if needed.

3

Embedded PPR Request Form

Let pilots submit PPR requests directly from your website

The embedded PPR form allows visiting pilots to request prior permission to land at your airfield without leaving your website. Submissions go directly into your British Airfields dashboard where you can approve, reject or manage them. The pilot's acceptance of the Pilot Indemnity Agreement is recorded electronically at the point of submission.

ppr.htmlHTML
<!-- Embed the PPR form in an auto-resizing iframe -->
<iframe
  src="https://britishairfields.com/embed/ppr-light?airfield=your-airfield-slug"
  id="ppr-frame"
  width="100%"
  frameborder="0"
  scrolling="no"
  style="min-height:800px;display:block;"
></iframe>

<!-- Auto-resize the iframe to fit the form -->
<script>
  window.addEventListener('message', function(e) {
    if (e.data && e.data.source === 'britishairfields-embed' && e.data.height) {
      document.getElementById('ppr-frame').style.height = e.data.height + 'px';
    }
  });
</script>

Replace your-airfield-slug with your airfield's slug. Use ppr-dark instead of ppr-light for a dark-themed form.

✅

All PPR submissions appear instantly in your British Airfields dashboard. Email notifications are sent to you and the pilot automatically.

4

Embedded Book Out Form

Allow pilots to register their departure before they go

The book out form lets pilots register their planned departure from your airfield, including destination and number of persons on board. This provides a safety record and feeds the outbound traffic schedule automatically.

bookout.htmlHTML
<iframe
  src="https://britishairfields.com/embed/bookout-light?airfield=your-airfield-slug"
  id="bookout-frame"
  width="100%"
  frameborder="0"
  scrolling="no"
  style="min-height:600px;display:block;"
></iframe>

<script>
  window.addEventListener('message', function(e) {
    if (e.data && e.data.source === 'britishairfields-embed' && e.data.height) {
      document.getElementById('bookout-frame').style.height = e.data.height + 'px';
    }
  });
</script>
✅

Book out entries appear immediately in the outbound traffic schedule and in your British Airfields dashboard.

5

Embedded Weather Widget

Drop-in weather card with live runway wind box, wind barb and conditions

For a fully rendered weather card — including the runway diagram, meteorological wind barb, crosswind component and live conditions — embed the British Airfields weather widget as an iframe. The widget reads your airfield's runway data and weather station feed automatically. No configuration required beyond your airfield slug.

weather.htmlHTML
<!-- Embedded weather widget with auto-resize -->
<iframe
  src="https://britishairfields.com/embed/weather-light?airfield=your-airfield-slug"
  id="weather-frame"
  width="100%"
  frameborder="0"
  scrolling="no"
  style="min-height:400px;display:block;"
></iframe>

<script>
  window.addEventListener('message', function(e) {
    if (e.data && e.data.source === 'britishairfields-embed' && e.data.height) {
      document.getElementById('weather-frame').style.height = e.data.height + 'px';
    }
  });
</script>

Use weather-dark instead of weather-light for a dark-themed card matching the British Airfields app style. The widget fills its container edge to edge — wrap it in your own card or container div to add borders and rounded corners.

✅

The widget displays the best runway for current wind conditions, the wind barb, headwind and crosswind components, temperature, humidity, dew point, QNH and QFE. It updates automatically every 30 seconds and falls back to Open-Meteo forecast data if no on-site weather station is configured.

6

Embedded METAR Widget

Drop-in METAR card showing flight category, wind, visibility, pressure and raw METAR string

The embedded METAR widget displays official aviation weather observations in a compact, styled card. It automatically finds the nearest currently-active METAR station for your airfield — no configuration required beyond your airfield slug.

metar-widget.htmlHTML
<iframe
  src="https://britishairfields.com/embed/metar-dark?airfield=your-airfield-slug"
  id="metar-frame"
  width="100%"
  frameborder="0"
  scrolling="no"
  style="min-height:200px;display:block;"
></iframe>

<script>
  window.addEventListener('message', function(e) {
    if (e.data && e.data.source === 'britishairfields-embed' && e.data.height) {
      document.getElementById('metar-frame').style.height = e.data.height + 'px';
    }
  });
</script>

Use metar-light instead of metar-dark for a light-themed card. The widget automatically finds the nearest active METAR station — no configuration required beyond your airfield slug.

✅

Displays flight category (VFR/MVFR/IFR/LIFR), wind speed and direction, visibility, temperature, dew point, QNH and raw METAR string. Updates every 5 minutes and automatically switches to the next nearest active station if the primary goes offline.

7

Live Webcam Feed

Show a live airfield camera image on your website

If your airfield has an IP camera or a webcam that uploads images to a web-accessible URL, you can display the live feed on your website. The simplest approach is a regularly refreshed image — no video streaming infrastructure required.

The image below automatically refreshes every 30 seconds. A cache-busting timestamp parameter ensures visitors always see the latest frame rather than a browser-cached version.

webcam.htmlHTML
<!-- Live webcam image with auto-refresh every 30 seconds -->
<img
  id="webcam"
  src="https://your-domain.com/CAM/airfield.jpg"
  alt="Live airfield camera"
  style="width:100%;border-radius:8px;"
/>

<script>
  setInterval(function() {
    var img = document.getElementById('webcam');
    img.src = 'https://your-domain.com/CAM/airfield.jpg?t=' + Date.now();
  }, 30000);  // refresh every 30 seconds
</script>

Replace the URL with the direct path to your camera image. The camera software must upload a fresh image to that URL at regular intervals — most IP cameras and webcam software support this natively.

✅

This approach works with any camera that can FTP or upload a JPEG to a web server. No video streaming, no special server software required. Contact us if you need help configuring your camera software.

8

Nearest METAR Station

Display live aviation weather observations from the nearest active reporting station

METAR data provides official aviation weather observations including wind, temperature, pressure, visibility and cloud cover. Rather than fetching METAR data through British Airfields, your website calls the aviation weather service directly — giving you full control and zero dependency on our infrastructure.

Because some stations go offline at weekends or outside hours (for example, Cambridge EGSC is often offline at weekends), British Airfields provides a lightweight lookup that always returns the nearest currently active station. Your website calls this once per page load, then fetches the METAR directly.

Step 1: Ask British Airfields for the nearest active station — this handles stations going offline automatically.

Step 2: Use the returned ICAO code to fetch the METAR directly from aviationweather.gov — a free US government service requiring no API key.

metar.htmlJavaScript
async function loadMetar() {

  // Step 1 — find nearest active METAR station
  const station = await fetch(
    'https://ixullegcsmyquncxrjcx.supabase.co/functions/v1/get-nearest-metar?airfield=your-airfield-slug'
  ).then(r => r.json())

  // Step 2 — fetch METAR directly from aviationweather.gov
  const data = await fetch(
    `https://aviationweather.gov/api/data/metar?ids=${station.icao}&format=json&hours=2`
  ).then(r => r.json())

  const m = data[0]
  if (!m) return

  // Use the data — all values in aviation units
  console.log('Station:', station.icao, station.name, station.distance_nm + 'nm')
  console.log('Wind:', m.wspd, 'kt from', m.wdir, '°')
  console.log('Temp:', m.temp, '°C  Dewpoint:', m.dewp, '°C')
  console.log('QNH:', Math.round(m.altim * 33.8639), 'hPa')
  console.log('Visibility:', m.visib, 'SM')
  console.log('Raw METAR:', m.rawOb)
}

loadMetar()

Key fields: wspd wind speed (kt) · wdir wind direction (°) · wgst gust (kt) · temp temperature (°C) · dewp dew point (°C) · altim altimeter (inHg — multiply by 33.8639 for hPa) · visib visibility (SM) · rawOb raw METAR string

✅

The nearest-station lookup is cached for 30 minutes and automatically switches to the next closest active station if the primary goes offline. METAR data from aviationweather.gov is free, requires no API key, and is not routed through British Airfields infrastructure.