Learn how to integrate OpenPIIMap data into your applications using our static JSON files and downloadable datasets.
Get started with OpenPIIMap data integration in under 5 minutes.
OpenPIIMap operates as a static site with JSON data files. No authentication required - simply fetch the data you need.
Understanding the JSON data structure for effective integration.
Access detailed information about privacy laws by country.
// Fetch countries data
fetch('/json/countries.json')
.then(response => response.json())
.then(data => {
console.log(data.germany); // Access Germany's GDPR data
});
{
"germany": {
"name": "Germany",
"framework": "GDPR",
"categories": [
{
"name": "Personal Identifiers",
"examples": ["Full Name", "Email Address", "Phone Number"]
}
],
"rights": ["Access", "Rectification", "Erasure"],
"penalties": {
"administrative_fines": "Up to €20M or 4% of global turnover"
}
}
}
Get framework-specific information across multiple jurisdictions.
// Fetch frameworks data
fetch('/json/frameworks.json')
.then(response => response.json())
.then(data => {
console.log(data.gdpr); // Access GDPR framework details
});
Real-world scenarios where OpenPIIMap data integration adds value to your systems.
Automatically verify if your data handling practices comply with local privacy laws.
async function checkCompliance(userLocation, dataTypes) {
const countries = await fetch('/json/countries.json').then(r => r.json());
const countryLaw = countries[userLocation.toLowerCase()];
if (!countryLaw) return { compliant: false, reason: 'Unknown jurisdiction' };
const violations = dataTypes.filter(type =>
countryLaw.categories.some(cat =>
cat.examples.includes(type) && cat.restrictions
)
);
return {
compliant: violations.length === 0,
framework: countryLaw.framework,
violations: violations
};
}
Apply appropriate data masking based on jurisdiction and data sensitivity.
async function getMaskingRules(country) {
const countries = await fetch('/json/countries.json').then(r => r.json());
const law = countries[country.toLowerCase()];
return law?.categories.map(category => ({
category: category.name,
fields: category.examples,
maskingRequired: category.sensitive || false,
retentionPeriod: category.retention || 'indefinite'
})) || [];
}
Implement user rights based on their jurisdiction's privacy laws.
async function getUserRights(userCountry) {
const countries = await fetch('/json/countries.json').then(r => r.json());
const law = countries[userCountry.toLowerCase()];
return law?.rights || ['Access']; // Default to basic access right
}
Step-by-step implementation guides for different programming languages.
class OpenPIIMapClient {
constructor(baseUrl = 'https://openpiimap.org') {
this.baseUrl = baseUrl;
this.cache = new Map();
}
async getCountries() {
if (this.cache.has('countries')) {
return this.cache.get('countries');
}
const response = await fetch(`${this.baseUrl}/json/countries.json`);
const data = await response.json();
this.cache.set('countries', data);
return data;
}
async getCountryLaw(country) {
const countries = await this.getCountries();
return countries[country.toLowerCase()] || null;
}
async getFrameworks() {
if (this.cache.has('frameworks')) {
return this.cache.get('frameworks');
}
const response = await fetch(`${this.baseUrl}/json/frameworks.json`);
const data = await response.json();
this.cache.set('frameworks', data);
return data;
}
}
import requests
import json
from typing import Dict, Optional
class OpenPIIMapClient:
def __init__(self, base_url: str = "https://openpiimap.org"):
self.base_url = base_url
self.cache = {}
def get_countries(self) -> Dict:
if 'countries' not in self.cache:
response = requests.get(f"{self.base_url}/json/countries.json")
response.raise_for_status()
self.cache['countries'] = response.json()
return self.cache['countries']
def get_country_law(self, country: str) -> Optional[Dict]:
countries = self.get_countries()
return countries.get(country.lower())
def get_frameworks(self) -> Dict:
if 'frameworks' not in self.cache:
response = requests.get(f"{self.base_url}/json/frameworks.json")
response.raise_for_status()
self.cache['frameworks'] = response.json()
return self.cache['frameworks']
// Initialize client
const client = new OpenPIIMapClient();
// Check if email processing is compliant in Germany
async function checkEmailCompliance() {
const germanyLaw = await client.getCountryLaw('germany');
if (germanyLaw) {
console.log(`Framework: ${germanyLaw.framework}`);
console.log(`User Rights: ${germanyLaw.rights.join(', ')}`);
// Check if email is considered PII
const emailCategory = germanyLaw.categories.find(cat =>
cat.examples.includes('Email Address')
);
if (emailCategory) {
console.log(`Email is PII under: ${emailCategory.name}`);
}
}
}
Guidelines for effective and efficient integration of OpenPIIMap data.