Skip to main content

Open public data

A free API for venue information

Read the same public venue information shown on Bars.co.uk. Each field keeps its source label. You do not need an account or API key.

Public information only

The API never returns private mediation cases, owner contact details, accounts, reporter details, exact incident dates, evidence or private messages. It may include the same limited mediation record that people agreed could appear on the public venue page.

Venue endpoint

Every venue page shows its permanent public ID and direct API link. Send a GET request to:

https://bars.co.uk/api/public/v1/venues/{publicVenueId}

The JSON response includes the official venue record, source label and date for each field, any published chain or group, public venue standard result, published information from the venue and the limited public mediation history.

An unknown ID returns an application/problem+json error response.

Use it from a website

A website on another domain can read this endpoint. It cannot send sign-in details or change data.

const response = await fetch(
  "https://bars.co.uk/api/public/v1/venues/7h3k2p"
);

if (!response.ok) throw new Error(`API returned ${response.status}`);
const venue = await response.json();

Community profile fields

When a venue has published its community profile, ownerProfile.communityImpact contains its local headline, summary, feature IDs and labels, total full-time and part-time staff, practical offers, local supplier information and the date it last checked the details.

const community = venue.ownerProfile?.communityImpact;

for (const feature of community?.features ?? []) {
  console.log(feature.id, feature.title, feature.category);
}

The API source value is Venue supplied. The website shows this as “From the venue”. Use the permanent IDs in your code because the public wording may improve. A missing field means “not supplied”. It does not prove that the venue lacks that service.

Public mediation history

mediationHistory contains the same limited public record shown on the venue page. It includes current totals, numbers by broad issue type, monthly numbers and issues that meet the publishing rules. Each issue has a simple status. The response does not reveal how many cases were kept private.

for (const issue of venue.mediationHistory.issues) {
  console.log(issue.receivedMonth, issue.category.label, issue.statusLabel);
  if (issue.publicOutcomeSummary) console.log(issue.publicOutcomeSummary);
}

An outcome only appears after the reporter and an authorised venue representative approve exactly the same wording. A staff privacy reviewer must also approve it.

A report asks for help to resolve an issue. It does not prove fault, wrongdoing or legal responsibility. Reports never affect the venue standard score, rank or search position.

Chain or group field

operatorRelationship matches the Chain or group field on the venue page. When published, it gives an operated_by or independent status, a group name where relevant, source label, source description and date checked.

A null value means that the relationship is unknown or not published. It does not prove that the venue is independent. This field is separate from official food hygiene data. The Food Standards Agency source credit does not cover it.

Rate limit

One client can make 30 requests in any 60-second period. Requests for different venue IDs use the same allowance. Successful requests, 304 responses and unknown IDs all count. Browser OPTIONS checks do not.

Every response includes RateLimit-Limit, RateLimit-Remaining and RateLimit-Reset. If you reach the limit, the 429 Too Many Requests response also includes Retry-After. Wait for that number of seconds before trying again.

Conditional requests

Each venue response includes an ETag, which is a code for that version of the data. Save it and send it in If-None-Match. If nothing changed, the API returns 304 Not Modified without sending the data again.

Rate-limit headers are different for each client. Browsers must therefore check their own saved response, and a shared content delivery network must not store it.

fetch(endpoint, {
  headers: { "If-None-Match": savedEtag }
});

Sources, attribution and reuse

Bars.co.uk combines information from several owners, with different reuse rules. Every response has a top-level attributions list. Each item names the provider and dataset, links to its terms and licence, gives the source dates and council area, and uses appliesTo to list the fields it covers.

Official food hygiene fields supplied through the Food Standards Agency service are reusable under the Open Government Licence v3.0. Preserve this notice: Contains public sector information licensed under the Open Government Licence v3.0.

The public sector licence only applies when licence.appliesToThisResponse is true. It only covers the fields listed in that item. It does not cover the Bars.co.uk venue standard, our writing, mediation records or community information from a venue.

Keep the source and update dates. Do not suggest that the source approves your service. Do not describe food hygiene data as alcohol licensing data.

Read the Food Standards Agency terms. They require consumers to use the current rating or indicate when it was updated. Official logos and rating imagery have separate conditions and are not granted for reuse merely by the data licence.

Offers, events, staff totals and access arrangements supplied by a venue can change. When you show them elsewhere, keep the confirmation date and availability note. Do not present them as official or independently audited facts.

The response Link header points to our data sources and licences page with rel="describedby". We do not put one licence on the whole response because it contains mixed sources. Read the service terms before publishing fields that are not public sector data.

Test data in this preview

The local preview uses clearly marked test records created by Bars.co.uk. They did not come from the Food Standards Agency. For these records, licence.appliesToThisResponse is false.

On the live service, check that value, the source dates and the public data-status endpoint before you rely on or share a response.