PHP Demographics Examples

From CDYNE Wiki
Jump to navigation Jump to search

GetIncomeHouseValueByAddress

 1 <?php
 2 $client = new SoapClient('http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl');
 3 $param = array(
 4 	'AddressLine1' => '505 Independence Parkway',
 5 	'City' => 'Chesapeake',
 6 	'StateAbbrev' => 'VA',
 7 	'ZipCode' => '23320',
 8 	'LicenseKey' => 'YOUR LICENSE KEY'
 9 );
10 $result = $client->GetIncomeHouseValueByAddress($param);
11 echo "<pre>";  //Used for friendlier formatting of return.
12 print_r($result);
13 echo "</pre>";
14 ?>

GetLocationInformationByAddress

 1 <?php
 2 $client = new SoapClient('http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl');
 3 $param = array(
 4 	'AddressLine1' => '505 Independence Parkway',
 5 	'City' => 'Chesapeake',
 6 	'StateAbbrev' => 'VA',
 7 	'ZipCode' => '23320',
 8 	'LicenseKey' => 'YOUR LICENSE KEY'
 9 );
10 $result = $client->GetLocationInformationByAddress($param);
11 echo "<pre>";  //Used for friendlier formatting of return.
12 print_r($result);
13 echo "</pre>";
14 ?>

GetLocationInformationByLatitudeLongitude

 1 <?php
 2 $client = new SoapClient('http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl');
 3 $param = array(
 4 	'Latitude' => '36.761560',
 5 	'Longitude' => '-76.259964',
 6 	'LicenseKey' => 'YOUR LICENSE KEY'
 7 );
 8 $result = $client->GetLocationInformationByLatitudeLongitude($param);
 9 echo "<pre>";  //Used for friendlier formatting of return.
10 print_r($result);
11 echo "</pre>";
12 ?>

GetPlaceIDbyAddress

 1 <?php
 2 $client = new SoapClient('http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl');
 3 $param = array(
 4 	'AddressLine1' => '505 Independence Parkway',
 5 	'City' => 'Chesapeake',
 6 	'StateAbbrev' => 'VA',
 7 	'ZipCode' => '23320',
 8 	'LicenseKey' => 'YOUR LICENSE KEY'
 9 );
10 $result = $client->GetPlaceIDbyAddress($param);
11 echo "<pre>";  //Used for friendlier formatting of return.
12 print_r($result);
13 echo "</pre>";
14 ?>

GetSummaryInformationByPlaceID

 1 <?php
 2 $client = new SoapClient('http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl');
 3 $param = array(
 4 	'StateAbbrev' => 'VA',
 5 	'PlaceID' => '0018466'
 6 );
 7 $result = $client->GetSummaryInformationByPlaceID($param);
 8 echo "<pre>";  //Used for friendlier formatting of return.
 9 print_r($result);
10 echo "</pre>";
11 ?>

GetVersion

1 <?php
2 $client = new SoapClient('http://ws.cdyne.com/DemographixWS/DemographixQuery.asmx?wsdl');
3 $param = array();
4 $result = $client->GetVersion($param);
5 echo "<pre>";  //Used for friendlier formatting of return.
6 print_r($result);
7 echo "</pre>";
8 ?>