API: Search for a school or district
Description: Search for a school by name
Destination: http://myschoolholidays.com/api/searchForSchoolOrDistrict?q=Southwark&country=gb
Response:
{"results":[{"name":"Southwark","id":"113","url":"\/gb--Southwark","countryCode":"gb","sourceType":"district","fullUrl":"http:\/\/myschoolholidays.com\/gb--Southwark"},{"name":"Southwark Park School","id":"11322","url":"Southwark-Park-School-11322","countryCode":"gb","town":"London","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/Southwark-Park-School-11322"},{"name":"Harris Academy Bermondsey","id":"56","url":"Harris-Academy-Bermondsey-56","countryCode":"gb","town":"London","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/Harris-Academy-Bermondsey-56"},{"name":"Southwark Primary School","id":"224","url":"Southwark-Primary-School-224","countryCode":"gb","town":"Nottingham","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/Southwark-Primary-School-224"},{"name":"The Cathedral School of St Saviour and St Mary Overie","id":"19564","url":"The-Cathedral-School-of-St-Saviour-and-St-Mary-Overie-19564","countryCode":"gb","town":"London","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/The-Cathedral-School-of-St-Saviour-and-St-Mary-Overie-19564"},{"name":"Southwark Inclusive Learning Service KS3 KS4 & Sils-","id":"615112","url":"Southwark-Inclusive-Learning-Service-KS3-KS4-&-Sils--615112","countryCode":"gb","town":"London","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/Southwark-Inclusive-Learning-Service-KS3-KS4-&-Sils--615112"},{"name":"The From Boyhood to Manhood Foundation","id":"14094","url":"The-From-Boyhood-to-Manhood-Foundation-14094","countryCode":"gb","town":"London","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/The-From-Boyhood-to-Manhood-Foundation-14094"},{"name":"St Georges Cathedral Catholic Primary School","id":"19552","url":"St-Georges-Cathedral-Catholic-Primary-School-19552","countryCode":"gb","town":"London","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/St-Georges-Cathedral-Catholic-Primary-School-19552"},{"name":"City of London Academy (Southwark)","id":"19","url":"City-of-London-Academy-(Southwark)-19","countryCode":"gb","town":"London","sourceType":"school","fullUrl":"http:\/\/myschoolholidays.com\/City-of-London-Academy-(Southwark)-19"}]}
Example code for developers to work with
PHP..
< ?php
$ch = curl_init ("http://myschoolholidays.com/api/searchForSchoolOrDistrict?q=Southwark&country=gb");
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec ($ch);
$results = json_decode($output);
print_r($results); // An array that contains the search results
// Link Url is provided as $fullUrl
?>