Back to MyChances API Main

Back to MyChances API Wiki

College Prediction API Demo


Most languages can interact with cURL (or have a script of their own to post to a page and retrieve the results).

Example in PHP:
	<?php
	$url = "https://www.parchment.com/c/api//predictionResource.php";
	$body = array('api_key' => 'your-secret-key','ipeds' => 151306,
		'app_type' => 'college', 'country' => 'USA', 'state' =>'NV', 
		'zip' => '89511', 'sex' => 'M', 'ethnicity' => 'Caucasian',
		'hs_type' => 'Private School', 'hs_id' => '18123', 'decile' => 'Valedictorian',
		'class_size' => '115', 'misconduct' => '0',
		'convicted' => '0', 'firstlanguage' => 'English', 
		'primarylanguage' => 'English', 'motherEducation' => '4y',
		'fatherEducation' => '4y', 'nationalmerit' => 'semifinalist', 
		'unweighted_gpa' => '3.96', 'weighted_gpa' => '4.19', 'weighted_gpa_max' => '5',
		'psat' => NULL, 'act' => '33', 'sat_verbal' => '760',
		'sat_writing' => NULL, 'sat_math' => '700', 'sat2_lit' => NULL,
		'sat2_us_hist' => NULL, 'sat2_world_hist' => NULL,
		'sat2_math_1' => NULL, 'sat2_math_2' => NULL, 'sat2_biology' => NULL,
		'sat2_chemistry' => NULL, 'sat2_physics' => NULL, 
		'sat2_chinese' => NULL, 'sat2_french' => NULL, 'sat2_french_listening' => NULL, 
		'sat2_german' => NULL, 'sat2_german_listening' => NULL, 'sat2_spanish' => NULL,
		'sat2_spanish_listening' => NULL, 'sat2_hebrew' => NULL, 
		'sat2_italian' => NULL, 'sat2_latin' => NULL, 
		'sat2_japanese_listening' => NULL, 'sat2_korean_listening' => NULL,
		'apcount' => '15', 'ap_art_history' => NULL, 'ap_biology' => '5', 
		'ap_calculus_ab' => '5', 'ap_calculus_bc' => NULL, 'ap_chemistry' => '5', 
		'ap_computer_science_a' => NULL, 'ap_computer_science_ab' => NULL, 
		'ap_macroeconomics' => NULL, 'ap_microeconomics' => NULL, 
		'ap_english_language' => '4', 'ap_english_literature' => NULL, 
		'ap_environmental_science' => NULL, 'ap_european_history' => NULL, 
		'ap_french_language' => NULL, 'ap_french_literature' => NULL, 
		'ap_german_language' => NULL, 'ap_comparative_government' => NULL, 
		'ap_us_government' => NULL, 'ap_human_geography' => NULL, 
		'ap_italian' => NULL, 'ap_latin_literature' => NULL, 
		'ap_latin_vergil' => NULL, 'ap_music' => NULL, 'ap_physics_b' => NULL, 
		'ap_physics_c' => NULL, 'ap_psychology' => NULL, 'ap_spanish_language' => NULL,
		'ap_spanish_literature' => NULL, 'ap_statistics' => NULL, 
		'ap_studio_art' => NULL, 'ap_us_history' => '5', 'ap_world_history' => NULL, 
		'ap_chinese' => NULL, 'ap_japanese' => NULL);
		
	$timeout=5;
	$c = curl_init ($url);
	
	curl_setopt($c, CURLOPT_HTTPHEADER, Array("Content-Type: text/xml"));
	curl_setopt($c, CURLOPT_HTTPHEADER, Array("Accept: text/xml")); 
	curl_setopt($c, CURLOPT_TIMEOUT, $timeout); // set timeout in seconds 
	curl_setopt ($c, CURLOPT_POST, true);
	curl_setopt ($c, CURLOPT_POSTFIELDS, $body);
	curl_setopt ($c, CURLOPT_RETURNTRANSFER, true);
	
	$data = curl_exec ($c);
	
	curl_close ($c);
	
	header("Content-type: text/xml"); 
	echo $data; 
	?>

You can see the actual response from this code here.

This example used the full variable set (with null values where a student didn't have certain parameters). However, you do not have to send us the full variable set. If you have any concerns about your proposed variable list, please email us with your proposed list of variables and any questions/concerns.

Thanks for choosing the MyChances College Admissions Prediction API!