paul
paul

Reputation: 15

Rome2Rio API Integration

I just wanted to know if anyone knows how I can integrate a travel/deals API on my college project website.

I have looked at the Rome2Rio API and signed up and have the API key but I have no idea what i do next.Or if you think that is a hard one to use could you suggest an alternative easy one to integrate.

Any help would be great. I have added a link below to the documentation that might help you.

http://www.rome2rio.com/documentation/search

Upvotes: 1

Views: 804

Answers (1)

Zankhana
Zankhana

Reputation: 32

$url = 'http://<server>/api/1.4/json/Search?key=<key>&oName=Bern&dName=Zurich&noRideshare';
$content = file_get_contents($url);
$json = json_decode($content, true);
$iterator = new RecursiveIteratorIterator(new RecursiveArrayIterator($json));
foreach($iterator as $key => $value) {
echo "<p>$key => $value</p>";
}

Upvotes: 0

Related Questions