The classifier API can be used by client applications to classify the legal problem that submitted text describes. It also attempts to geocode a location submitted with the text and return government- and public housing-related information.
/api/classify
POST
api_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
{
text: [string containing the text to be classified],
document: [string containing base64-encoded file (image or pdf) to be classified],
location: [string containing the location to be geocoded]
}
{
"code": [string containing the classified code],
"geo": {
"address": [string with cleaned version of submitted address],
"censusBlock": {
"FIPS": [string]
},
"congressionalDistrict": {
"district": [string],
"state": [string]
},
"coordinates": {
"lat": [float],
"lng": [float]
},
"county": [string],
"publicHousingDetails": null or {
"address": [string],
"community": [string],
"description": [string],
"headline": [string],
"name": [string],
"property-type": [string],
"wait-list-status": [string]
},
"stateGovernment": {
"lower": {
"district": [string],
"name": [string]
},
"upper": {
"district": [string],
"name": [string]
}
},
"zipCode": [string]
},
"message": [string],
"otherProbabilities": [
{
"code": [string],
"probability": [float]
},
...
],
"probability": [float],
"sessionId": [string]
}
curl -H "Content-Type: application/json" \
-X POST \
-d '{"location":"San Antonio, Texas", "text":"I am having trouble with child support"}' \
https://houston.ai/api/classify?api_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
/api/classify-feedback
POST
api_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
{
sessionId: [text containing sesssionId from classify response],
wasCorrect: [boolean],
actualCode: [string],
comment: [string]
}
{
"status": "success"
}
The problem codes API returns a list of problem code groups, with their member codes.
/api/problem-codes
GET
api_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
{
"codeGroups": [
{
"groupName": "Consumer",
"codes": [
{
"code": "01",
"label": "Bankruptcy/Debtor Relief"
},
{
"code": "02",
"label": "Collect/Repo/Def/Garnsh"
},
{
"code": "03",
"label": "Contract/Warranties"
},
...
]
}
The Geocode API can be used by client applications to obtain government and housing information about the submitted address.
/api/geocode
POST
api_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
{
address: [string containing the location to be geocoded]
}
{
"address": [string with cleaned version of submitted address],
"censusBlock": {
"FIPS": [string]
},
"congressionalDistrict": {
"district": [string],
"state": [string]
},
"coordinates": {
"lat": [float],
"lng": [float]
},
"city": [string],
"county": [string],
"state": [string],
"zipCode": [string],
"publicHousingDetails": null or {
"address": [string],
"community": [string],
"description": [string],
"headline": [string],
"name": [string],
"property-type": [string],
"wait-list-status": [string]
},
"stateGovernment": {
"lower": {
"district": [string],
"name": [string]
},
"upper": {
"district": [string],
"name": [string]
}
}
}
curl -H "Content-Type: application/json" \
-X POST \
-d '{"address":"2245 S. Stewart Ave Chicago"}' \
https://houston.ai/api/geocode?api_key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx