Get help with morph.io and scraping

Hello Scraper: the first scraper

Hello scraper in php

<?php
$key="[API KEY]";
$query="select * from 'data' limit 10";
$url = "https://api.morph.io/[USERNAME]/[SCRAPER NAME]/data.json";

$response=file_get_contents($url.'?key='.$key.'&query='.urlencode($query));
$js=json_decode($response,true);

foreach ($js as $line){
  [DO WIZARDRY]
}
?>

@sabas, would you mind if we used your example here for the main documentation https://morph.io/documentation/api, so it could be used as a simple example of how to get data out of the morph api in php?

Hi @sabas - I realise now you probably missed that question from me because you probably didn’t receive an email letting you know. We’ve just fixed the email notification from here!

Hi @mlandauer now I got the notification via email :smile:

Yes you can use it obviously.

Awesome. Thanks very much!

Your example code is now part of the documentation at https://morph.io/documentation/api. Thanks again @sabas!