# Licensing Documentation

This document provides comprehensive information about all licenses used in this project, compliance requirements, and license verification processes.

## Overview

This project uses data from multiple sources, each with different licensing requirements:

1. **ONS Postcode Directory** - Open Government Licence v3.0
2. **postcodes.io API** - MIT License (fallback mechanism)
3. **Council Parking Permit Data** - Various licenses (OGL v3.0, PSI, or council-specific)
4. **DVLA Vehicle Enquiry Service API** - Government API with terms of service

## Open Government Licence v3.0

### Overview

The Open Government Licence v3.0 (OGL v3.0) is a copyright license for Crown copyright and database rights in public sector information.

**Official License Text:**
- Full license text: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
- License FAQ: https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/open-government-licence/

### License Requirements

**What the OGL v3.0 Allows:**
- Copy, publish, distribute, and transmit the information
- Adapt the information
- Exploit the information commercially and non-commercially

**What the OGL v3.0 Requires:**
- Acknowledge the source of the information
- Include a link to the Open Government Licence v3.0
- Indicate if you have made changes to the information
- Do not use the information in a misleading way
- Do not suggest that the information provider endorses your use of the information

**What the OGL v3.0 Excludes:**
- Personal data
- Information that has neither been published nor disclosed under information access legislation
- Departmental or public sector organisation logos
- Military insignia
- Third-party rights (copyright, database rights, or other intellectual property rights not owned by the information provider)

### OGL v3.0 Compliance

**Attribution Requirements:**
- Must acknowledge the source: "Contains public sector information licensed under the Open Government Licence v3.0"
- Must include a link to the OGL v3.0 license text
- Must indicate if information has been modified

**Compliance Checklist:**
- [x] Attribution statement included in footer
- [x] Link to OGL v3.0 license included
- [x] Source acknowledged (ONS Postcode Directory, council data)
- [x] Modifications indicated (postcode data processed and sharded)
- [x] No misleading use of information
- [x] No suggestion of endorsement

### Data Sources Using OGL v3.0

**ONS Postcode Directory:**
- Source: Office for National Statistics
- License: Open Government Licence v3.0
- Attribution: "Contains public sector information licensed under the Open Government Licence v3.0"
- Modifications: Postcode data has been processed and sharded for efficient lookup
- Coverage: England, Scotland, Wales (Northern Ireland excluded due to licensing restrictions)

**OGL-Licensed Councils (Confirmed):**
- London Borough of Camden
- London Borough of Islington
- London Borough of Hackney
- London Borough of Southwark
- London Borough of Waltham Forest
- Leeds City Council

**OGL-Licensed Councils (Statement Present):**
- City of Westminster (OGL statement on site; confirm annually)
- London Borough of Lambeth (OGL statement present)
- London Borough of Tower Hamlets (OGL statement present)

**OGL-Licensed Councils (Pending Confirmation):**
- Royal Borough of Kensington and Chelsea (Assumed OGL; written confirmation required)
- Many other councils (see data source inventory for complete list)

## Public Sector Information (PSI) Licensing

### Overview

Public Sector Information (PSI) licensing is used by Scottish councils and public sector organisations in Scotland.

**PSI Licensing Requirements:**
- Attribution to the source council is typically required
- Attribution wording may vary by council
- PSI licensing is similar to OGL but may have different requirements

### PSI-Licensed Councils

**City of Edinburgh Council:**
- License: PSI-compliant
- Attribution: Attribution wording confirmation recommended
- Status: Confirmed PSI-compliant
- Notes: Attribution wording should be confirmed with council

**Glasgow City Council:**
- License: PSI licence
- Attribution: Reuse terms confirmation recommended
- Status: Confirmed PSI licence
- Notes: Reuse terms should be confirmed with council

### PSI Compliance

**Attribution Requirements:**
- Must attribute parking permit data to the respective council sources
- Attribution wording should be confirmed with council
- PSI licensing typically requires attribution similar to OGL

**Compliance Checklist:**
- [x] Attribution to council sources included
- [ ] Attribution wording confirmed with councils (recommended)
- [ ] Reuse terms confirmed with councils (recommended)

## Other Licensing Arrangements

### Brighton & Hove City Council
- License: OGL-like with attribution required
- Attribution: Attribution required
- Status: Confirmed OGL-like license
- Notes: Attribution must be included

### Manchester City Council
- License: Copyright © MCC; OGL confirmation requested
- Attribution: Copyright notice required
- Status: OGL confirmation requested
- Notes: OGL confirmation should be requested from council

### Bristol City Council
- License: CAZ data open; permit licence check pending
- Attribution: Varies by data type
- Status: Permit licence check pending
- Notes: CAZ data is open; permit licence should be confirmed

## DVLA Vehicle Enquiry Service API

### Overview

The DVLA Vehicle Enquiry Service API provides vehicle information based on vehicle registration marks (VRM).

**API Documentation:**
- Developer Portal: https://developer-portal.dvla.gov.uk/
- API Terms of Service: https://register-for-ves.driver-vehicle-licensing.api.gov.uk/terms-and-conditions

### Terms of Service

**Official Terms:**
- Terms and Conditions: https://register-for-ves.driver-vehicle-licensing.api.gov.uk/terms-and-conditions
- Registration: https://register-for-ves.driver-vehicle-licensing.api.gov.uk/

**Key Requirements from Terms:**
- **API Key Registration:** Only one API key permitted per customer/company. Multiple keys may result in access revocation.
- **Data Protection:** If DVLA data is combined with other data to identify individuals, compliance with Data Protection Legislation is required.
- **Audit Cooperation:** DVLA reserves the right to audit compliance. Full cooperation is required.
- **Data Incidents:** Must notify DVLA within 24 hours of any data loss, misuse, or compromise.
- **Data Accuracy:** DVLA does not warrant data accuracy and does not accept liability for inaccuracies from vehicle keepers or other sources.

**Data Usage Restrictions:**
- VRM data must be transmitted directly to the DVLA API only
- No VRM data may be stored, logged, or cached by this service
- VRM data must not be shared with third parties (except DVLA API)
- VRM data must not be used for purposes other than vehicle lookup

**Rate Limiting:**
- Rate limits apply (typically 600 requests per hour)
- Rate limiting is enforced by the DVLA API
- Service availability depends on DVLA API accessibility

**Privacy Requirements:**
- VRM data is personal information (PII)
- VRM data must not be stored or logged
- VRM data must be transmitted securely
- VRM data must be redacted in any error logs

**Attribution Requirements:**
- **Unlike OGL:** DVLA API data does NOT require visible attribution statements (unlike Open Government Licence which requires "Contains public sector information licensed under the Open Government Licence v3.0")
- **Transparency:** Good practice to link to DVLA terms of service and provide transparency about data source
- **No Copyright Notice Required:** No specific Crown copyright notice required for display (unlike OGL data)

### Compliance

**Compliance Checklist:**
- [x] VRM data transmitted directly to DVLA API only
- [x] No VRM data stored or logged
- [x] No VRM data cached
- [x] VRM data redacted in error logs
- [x] Rate limiting implemented
- [x] Privacy information provided to users
- [x] Terms of service linked in disclaimer
- [x] API key registration completed (single key per organization)
- [x] Data protection compliance measures in place
- [x] Audit cooperation procedures documented

## postcodes.io API

### Overview

The postcodes.io API is an open-source UK postcode lookup and geocoding API maintained by Ideal Postcodes. This service uses the postcodes.io API as a fallback mechanism when local postcode shard files are unavailable.

**API Documentation:**
- API Website: https://postcodes.io/
- Licence Information: https://postcodes.io/docs/licences
- Source Code: https://github.com/ideal-postcodes/postcodes.io

### License

**API License:**
- The postcodes.io API source code is licensed under the MIT License
- MIT License allows free use for both commercial and non-commercial purposes
- No API key required for basic usage

**Usage:**
- Used as a fallback when local postcode shard files are missing or unavailable
- Provides postcode to council lookup functionality
- Coverage: Great Britain postcodes (England, Scotland, Wales)

### Data Sources and Copyright

The postcodes.io API uses data from multiple sources, each with their own licensing terms and copyright:

**Great Britain Postcode Data:**
- Source: Ordnance Survey OS OpenData
- License: OS OpenData Licence (permits free use for commercial and non-commercial purposes)
- Copyright: Ordnance Survey data © Crown copyright and database right 2025

**Additional Data Sources:**
- Royal Mail data © Royal Mail copyright and database right 2025
- National Statistics data © Crown copyright and database right 2025
- National Records of Scotland data © Crown copyright and database right 2025

**Northern Ireland Postcode Data:**
- Northern Ireland (BT) postcodes are excluded from this service
- Commercial use of BT postcodes requires a licence from Northern Ireland's Land & Property Services
- This service does not use BT postcode data from postcodes.io API

### Compliance

**Compliance Checklist:**
- [x] postcodes.io API used only as fallback mechanism
- [x] Crown copyright attributions included in disclaimer
- [x] Royal Mail copyright attribution included
- [x] Northern Ireland (BT) postcodes excluded
- [x] Link to postcodes.io licence documentation provided
- [x] Attribution requirements met for underlying data sources

**Attribution Requirements:**
- Crown copyright notices required for Ordnance Survey, National Statistics, and National Records of Scotland data
- Royal Mail copyright notice required
- Attribution included in disclaimer.html Data Sources section

## Council License Status

### License Status Categories

**Confirmed OGL:**
- Council has confirmed Open Government Licence v3.0 licensing
- Attribution requirements are clear
- No additional confirmation needed

**OGL Statement Present:**
- Council website has OGL statement
- Confirmation recommended but not required
- Attribution requirements are clear

**PSI-Licensed:**
- Council uses Public Sector Information (PSI) licensing
- Attribution requirements may vary
- Attribution wording confirmation recommended

**Pending Confirmation:**
- Council license status is unclear
- License confirmation is required
- Attribution requirements are unknown

**Other Licensing:**
- Council has other licensing arrangements
- License terms may vary
- Attribution requirements should be confirmed

### License Verification Process

**Steps for Verifying Council License Status:**
1. Check council website for license information
2. Look for OGL v3.0 statements or links
3. Check council copyright notices
4. Contact council for license confirmation if needed
5. Document license status in catalog.json
6. Update attribution requirements as needed

**License Confirmation Template:**
```
Subject: Parking Permit Data License Confirmation

Dear [Council Name],

I am writing to confirm the licensing arrangements for parking permit pricing data published on your website.

We are developing a service that provides parking permit cost information to UK residents. We would like to use your parking permit pricing data in our service.

Could you please confirm:
1. What license applies to your parking permit pricing data?
2. Are there any specific attribution requirements?
3. Are there any restrictions on the use of this data?

Thank you for your assistance.

Best regards,
[Your Name]
```

## Attribution Requirements

### OGL v3.0 Attribution

**Required Attribution Statement:**
"Contains public sector information licensed under the Open Government Licence v3.0"

**Required Attribution Elements:**
- Attribution statement
- Link to OGL v3.0 license text
- Source acknowledgment (ONS Postcode Directory, council name)
- Modification indication (if applicable)

### PSI Attribution

**Required Attribution Elements:**
- Attribution to council source
- Council name
- Attribution wording (as required by council)

### Other Attribution

**Required Attribution Elements:**
- Attribution as required by council license
- Council name
- License information (if applicable)

## License Verification Process

### For New Councils

**Steps:**
1. Check council website for license information
2. Look for OGL v3.0 statements or links
3. Check council copyright notices
4. Contact council for license confirmation if needed
5. Document license status in catalog.json
6. Update attribution requirements as needed

### For Existing Councils

**Steps:**
1. Review license status in catalog.json
2. Verify license status on council website
3. Update license status if changed
4. Update attribution requirements if needed
5. Document changes in catalog.json

## License Compliance Monitoring

### Regular Reviews

**Review Schedule:**
- Annual review of all council license statuses
- Quarterly review of OGL v3.0 compliance
- Monthly review of DVLA API terms of service (https://register-for-ves.driver-vehicle-licensing.api.gov.uk/terms-and-conditions)
- Ad-hoc review when council websites are updated

### Compliance Checks

**OGL v3.0 Compliance:**
- Attribution statement present
- Link to OGL v3.0 license included
- Source acknowledged
- Modifications indicated
- No misleading use
- No suggestion of endorsement

**PSI Compliance:**
- Attribution to council sources included
- Attribution wording confirmed (recommended)
- Reuse terms confirmed (recommended)

**DVLA API Compliance:**
- VRM data transmitted directly to DVLA API only
- No VRM data stored or logged
- No VRM data cached
- VRM data redacted in error logs
- Rate limiting implemented
- Privacy information provided
- Terms of service linked and accessible
- API key usage compliant (single key per organization)
- Data protection measures in place
- Audit cooperation procedures ready

## License Documentation

### Documentation Files

**Main Documentation:**
- `disclaimer.html` - Comprehensive disclaimer and legal information
- `docs/licensing.md` - This file (licensing documentation)
- `docs/data-source-inventory.md` - Data source inventory with license statuses
- `README.md` - Project README with license information

**Data Files:**
- `data/councils/catalog.json` - Council catalog with license statuses
- `postcodes/README.md` - Postcode data documentation with attribution

### License Status Tracking

**Catalog.json Fields:**
- `licenceNote` - License status note
- `licenceType` - License type (OGL, PSI, Other, Pending)
- `licenceUrl` - Link to council license page (if available)
- `attributionRequired` - Whether attribution is required
- `lastVerified` - Date of last license verification

## Contact Information

### For License Inquiries

**ONS Postcode Directory:**
- Office for National Statistics
- Website: https://www.ons.gov.uk/
- License Information: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/

**DVLA API:**
- Driver and Vehicle Licensing Agency
- Developer Portal: https://developer-portal.dvla.gov.uk/
- Terms of Service: https://register-for-ves.driver-vehicle-licensing.api.gov.uk/terms-and-conditions
- Registration: https://register-for-ves.driver-vehicle-licensing.api.gov.uk/

**Councils:**
- Contact individual councils for license confirmation
- See data source inventory for council contact information

### For Legal Inquiries

**Legal Advice:**
- Consult with a qualified legal professional for specific legal advice
- Refer to disclaimer.html for comprehensive legal information
- Contact the service provider through the project repository (if available)

## Additional Resources

### Official License Texts

**Open Government Licence v3.0:**
- Full license text: https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
- License FAQ: https://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/uk-government-licensing-framework/open-government-licence/

**PSI Licensing:**
- PSI Directive: https://www.gov.uk/government/publications/re-use-of-public-sector-information-regulations-2015
- Scottish PSI: Contact individual councils for PSI licensing information

**DVLA API:**
- Developer Portal: https://developer-portal.dvla.gov.uk/
- API Documentation: https://developer-portal.dvla.gov.uk/api-documentation
- Terms and Conditions: https://register-for-ves.driver-vehicle-licensing.api.gov.uk/terms-and-conditions

### Related Documentation

**Project Documentation:**
- [Disclaimer Page](../disclaimer.html) - Comprehensive disclaimer and legal information
- [Data Source Inventory](data-source-inventory.md) - Data source inventory with license statuses
- [README](../README.md) - Project README with license information
- [DVLA Compliance Checklist](dvla-compliance-checklist.md) - Comprehensive DVLA API compliance checklist

**External Resources:**
- [OGL v3.0 License Text](https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/)
- [ONS Postcode Directory](https://geoportal.statistics.gov.uk/datasets/cfd03a224ae24db483f89051c35d4d29_0/explore)
- [DVLA Developer Portal](https://developer-portal.dvla.gov.uk/)

## Revision History

**Last Updated:** January 2025

**Revision Notes:**
- Initial license documentation created
- OGL v3.0 compliance documented
- PSI licensing requirements documented
- DVLA API terms of service documented
- Council license statuses documented
- Attribution requirements documented
- License verification process documented

