API Documentation
Base URL
https://floodcert.org/api
API Version
v1
Format
JSON
Authentication
API Key Authentication
All API requests require authentication using your API key in the header:
HTTP Header
X-API-Key: your-api-key-here
Python Example
import requests
api_key = "your-api-key-here"
headers = {
"X-API-Key": api_key,
"Content-Type": "application/json"
}
response = requests.get("https://floodcert.org/api/lenders/", headers=headers)
Keep your API key secure
Never share your API key or commit it to version control. Use environment variables or secure configuration management.
GET
/api/lenders/
Get Lenders
Retrieve a list of all registered lenders associated with your account.
Python
import requests
url = "https://floodcert.org/api/lenders/"
headers = {
"X-API-Key": "your-api-key",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
lenders = response.json()
# Example response handling
if response.status_code == 200:
for lender in lenders['lenders']:
print(f"ID: {lender['id']}")
print(f"Name: {lender['name']}")
print(f"Servicer ID: {lender['servicer_id']}")
cURL
curl -X GET "https://floodcert.org/api/lenders/" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json"
Response
{
"count": 2,
"lenders": [
{
"id": 1,
"name": "Example Bank",
"servicer_id": "EB123",
"email": "contact@examplebank.com",
"address": {
"line1": "123 Main St",
"city": "Anytown",
"state": "CA",
"zip": "12345"
}
}
]
}
POST
/api/generate-pdf/
Create Certificate Request
Generate a new flood certification request for a property.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| address | string | Required | Property address for flood certification |
| loan_number | string | Required | Loan identifier number |
| lender_id | integer | Required | ID of the registered lender |
| borrower_name | string | Optional | Name of the borrower |
Python
import requests
url = "https://floodcert.org/api/requests/create/"
headers = {
"X-API-Key": "your-api-key",
"Content-Type": "application/json"
}
data = {
"address": "1708 Roydon Trail, Annapolis MD 21401",
"loan_number": "44444555",
"lender_id": 1,
"borrower_name": "John Appleseed"
}
response = requests.post(url, json=data, headers=headers)
if response.status_code == 201:
request_id = response.json()['id']
print(f"Certificate request created with ID: {request_id}")
cURL
curl -X POST "https://floodcert.org/api/requests/create/" \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"address": "1708 Roydon Trail, Annapolis MD 21401",
"loan_number": "44444555",
"lender_id": 1,
"borrower_name": "John Appleseed"
}'
Response
{
"id": 12345,
"user": "username",
"lender": "Example Bank",
"property_address": "1708 Roydon Trail, Annapolis MD 21401",
"loan_number": "44444555",
"status": "pending"
}
GET
/api/certificates/{request_id}/
Download Certificate
Download the generated flood certification PDF for a specific request.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| request_id | integer | The ID of the certificate request |
Python
import requests
request_id = "12345"
url = f"https://floodcert.org/api/certificates/{request_id}/"
headers = {
"X-API-Key": "your-api-key",
"Accept": "application/pdf"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
with open(f"certificate_{request_id}.pdf", "wb") as f:
f.write(response.content)
print(f"Certificate downloaded successfully")
cURL
curl -X GET "https://floodcert.org/api/certificates/12345/" \
-H "X-API-Key: your-api-key" \
-H "Accept: application/pdf" \
--output certificate.pdf
Credit Usage
Downloading a certificate will consume one credit from your balance for prepaid accounts.
GET
/api/invoices/{request_id}/
Download Invoice
Download the invoice PDF for a specific certificate request.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| request_id | integer | The ID of the certificate request |
Python
import requests
request_id = "12345"
url = f"https://floodcert.org/api/invoices/{request_id}/"
headers = {
"X-API-Key": "your-api-key",
"Accept": "application/pdf"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
with open(f"invoice_{request_id}.pdf", "wb") as f:
f.write(response.content)
print(f"Invoice downloaded successfully")
cURL
curl -X GET "https://floodcert.org/api/invoices/12345/" \
-H "X-API-Key: your-api-key" \
-H "Accept: application/pdf" \
--output invoice.pdf
GET
/api/certificates/{request_id}/data/
Get Certificate Data
Retrieve detailed certificate data for a specific request in JSON format.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| request_id | integer | The ID of the certificate request |
Python
import requests
request_id = "12345"
url = f"https://floodcert.org/api/certificates/{request_id}/data/"
headers = {
"X-API-Key": "your-api-key",
"Accept": "application/json"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
certificate_data = response.json()
print(f"Certificate ID: {certificate_data['certificate_info']['certificate_id']}")
print(f"Flood Zone: {certificate_data['certificate_info']['flood_zone']}")
print(f"Property: {certificate_data['request_info']['property_address']}")
cURL
curl -X GET "https://floodcert.org/api/certificates/12345/data/" \
-H "X-API-Key: your-api-key" \
-H "Accept: application/json"
Response
{
"request_info": {
"request_id": 12345,
"status": "completed",
"created_at": "2024-03-15T14:30:00Z",
"property_address": "123 Main St, Anytown, USA",
"loan_number": "LN12345",
"borrower_name": "John Doe"
},
"lender_info": {
"name": "Example Bank",
"servicer_id": "EB123",
"address": {
"line1": "456 Bank Ave",
"line2": "Suite 100",
"city": "Banktown",
"state": "CA",
"zip": "12345"
}
},
"certificate_info": {
"certificate_id": 67890,
"issued_at": "2024-03-15T14:35:00Z",
"flood_zone": "X",
"nfip_community_name": "Anytown",
"counties": "Example County",
"state": "CA",
"community_number": "123456",
"map_number": "06001C0123F",
"revision_date": "2024-01-01",
"is_flood_zone": false,
"is_not_flood_zone": true,
"flood_insurance_is_available": true,
"regular_program_is_available": true,
"emergency_program_of_nfip": false,
"federal_flood_insurance_not_available": false,
"coastal_barrier_area": false,
"cbra_opa_designation_date": null,
"commentary": ""
}
}