- Previous: find_business Search
- Up: WhitePages.com API Documentation
- Next: Responses
JSON Output
In addition to the usual XML output, the WhitePages.com API can produce JSON output. The methods and responses are the same whether XML or JSON output is requested, only the format of the response is changed.
To use the WhitePages.com API with JSON output, an additional parameter must be supplied on the query request.
;outputtype=JSON
If this parameter is to be used it must be capitalized as shown. The parameter name outputtype is all lower case. The
selected type JSON is all upper case.
Example Results Response
An example of a reverse_phone request using JSON is shown below.
http://api.whitepages.com/reverse_phone/1.0/?phone=2069730000;api_key=API_KEY;outtputtype=JSON
The corresponding JSON output will look like this:
{
"listings" : [
{
"listingmeta" : {
"type" : "home",
"lastvalidated" : "02/2008",
"moreinfolinks" : {
"findneighbors" : {
"linktext" : "Find Neighbors",
"url" : "http://www.whitepages.com/16176/track/10214/search/FindNeighbors?addr_research=1&tmpl=search_research_neighbors&search_id=10201401160854491598&rarl=&element_id=1"
},
"viewmap" : {
"linktext" : "View Map",
"url" : "http://www.whitepages.com/16176/track/10213/map_provider?full_address=2468+Main+St&city=Seattle&state=WA&zip=98101&country=US&lat=41.876840&long=-87.638160&name=Smith&firstname=Mike&show_form=false"
},
"drivingdirections" : {
"linktext" : "Driving Directions",
"url" : "http://www.whitepages.com/16176/track/10216/map_provider?=&show_form=true&full_address=2468+Main+St&city=Seattle&state=WA&zip=98101&country=US&lat=41.876840&long=-87.638160&name=Smith&firstname=Mike"
},
"viewdetails" : {
"linktext" : "View Listing Detail",
"url" : "http://www.whitepages.com/16176/track/10215/search/Replay?search_id=10201401160854491598&lower=1&more_info=1"
}
}
},
"people" : [
{
"firstname" : "Mike",
"lastname" : "Smith",
"rank" : "primary"
}
],
"geodata" : {
"longitude" : "-87.638160",
"latitude" : "41.876840",
"geoprecision" : "1"
},
"address" : {
"country" : "US",
"house" : "2468",
"street" : "Main St",
"fullstreet" : "2468 Main St",
"state" : "WA",
"city" : "Seattle",
"zip" : "98101",
"streettype" : "St",
"deliverable" : "true"
},
"phonenumbers" : [
{
"linenumber" : "0000",
"areacode" : "206",
"fullphone" : "(206) 973-0000",
"type" : "landline",
"rank" : "primary",
"exchange" : "973"
}
]
}
],
"meta" : {
"apiversion" : "1.0",
"linkexpiration" : "2008-03-25",
"searchlinks" : {
"homepage" : {
"linktext" : "Whitepages.com",
"url" : "http://www.whitepages.com/16176/"
},
"mapallresults" : {
"linktext" : "View Map of All Results",
"url" : "http://www.whitepages.com/16176/track/10212/search/Replay?search_id=10201401160854491598&lower=1&view=map"
},
"self" : {
"linktext" : "Link to this api call",
"url" : "http://apiqa.whitepages.com/reverse_phone/1.0?phone=2069730000;api_key=9e51befe7fc95031a40dcb70f94c79de;outputtype=JSON"
}
},
"recordrange" : {
"lastrecord" : "1",
"firstrecord" : "1",
"totalavailable" : 1
},
"searchid" : "10201401160854491598"
},
"result" : {
"type" : "success",
"code" : "Found Data",
"message" : " "
}
}
Example Error Response
An example of an error using JSON is shown below.
http://api.whitepages.com/find_person/1.0/?lastnxame=smith;api_key=API_KEY;outtputtype=JSON
The corresponding JSON output will look like this:
{
"errors" : [
"Invalid Input Parameter: lastnxame"
],
"result" : {
"type" : "error",
"message" : "One or more input parameters are invalid",
"code" : "Invalid Input"
}
}
Return to the main documentation page
Copyright © 2008 WhitePages.com. All rights reserved.
- Previous: find_business Search
- Up: WhitePages.com API Documentation
- Next: Responses

Comments
Please sign in to post a comment.