<form method="post" accept-charset="utf-8">
<label>Запрос</label><input type="text" name="q" value="">
<br>
<label>Регион</label><input type="text" name="r" value="255">
<br>
<label>Лимит</label><input type="text" name="r" value="10">
<input type="submit">
</form>
<?
if (isset($_POST['q'])) {
$params = array(
'query' => htmlspecialchars($_POST['q']),
'region' => intval($_POST['r']),
'limit' => intval($_POST['r'])
);
$ch = curl_init('http://api.pr-cy.ru/realtime/yandex/serp?' . http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('X-Api-Key: ВАШ_КЛЮЧ'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$json = json_decode(curl_exec($ch));
echo '<pre>';
print_r($json);
}
?>