Jump to content

Server List API


Recommended Posts

Posted (edited)
<?php
	$url = "https://servers.openrct2.website";
	$headers = array(
		"GET HTTP/1.1",
		"Accept: application/json"
	);

	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_TIMEOUT, 60);
	curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
		
	$data = curl_exec($ch);

	if (curl_errno($ch))
		print "Error: " . curl_error($ch);
	else {
		//Show output
		var_dump($data);
	}

	curl_close($ch);

This should work! (untested)

Edited by JarnoVgr

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...