Use of the API requires authentication with your API key. Your key is displayed in the right column in your dashboard. If you do not yet have an account, please register for a free account.
fetch is trickier to use than wget and curl because it does not follow all redirections. Instead of one command, you will need to run a small loop:
$ FILE="/tmp/mobilito.png"; for I in {1..10}; do fetch -o $FILE "https://api.browshot.com/api/v1/simple?url=http://mobilito.net/&key=my_api_key";
if [ -e $FILE ] ; then break; fi ; done;
fetch: https://api.browshot.com/api/v1/simple?url=http://mobilito.net/&key=my_api_key: Moved Temporarily
fetch: https://api.browshot.com/api/v1/simple?url=http://mobilito.net/&key=my_api_key: Moved Temporarily
/tmp/mobilito.png: 100% of 5055 B 31 MBps
$ file /tmp/mobilito.png
/tmp/mobilito.png: PNG image data, 1024 x 768, 8-bit/color RGB, non-interlaced This runs the same command up to 10 times until the screenshot is saved to disk.
You can use any of the options listed on the API page. Here are some common use cases:
$ FILE="/tmp/mobilito.png"; for I in {1..10}; do fetch -o $FILE "https://api.browshot.com/api/v1/simple?url=http://mobilito.net/&key=my_api_key&width=640&size=page"; if [ -e $FILE ] ; then break; fi ; done; $ FILE="/tmp/mobilito.png"; for I in {1..10}; do fetch -o $FILE "https://api.browshot.com/api/v1/simple?url=http://mobilito.net/&key=my_api_key&width=640"; if [ -e $FILE ] ; then break; fi ; done; All options can be combined. See the API page for the full list.
no credit card required