Binary files
Point the API at any binary file under 2MB (images, PDFs, audio, etc.) and it returns a JSON object containing a base64_string key with the file encoded as a data URI.
Endpoint
Section titled “Endpoint” GET https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=<BINARY_FILE_URL>&binary_response=1
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | string | yes | Your Web Scraping API key |
url | string | yes | URL of the binary file to fetch. |
binary_response | integer | no | Set to 1 to force the binary response format. |
Example request
Section titled “Example request”curl "https://scrape.shifter.io/v1?api_key=YOUR_API_KEY&url=https%3A%2F%2Fupload.wikimedia.org%2Fwikipedia%2Fcommons%2Fthumb%2F2%2F2f%2FGoogle_2015_logo.svg%2F440px-Google_2015_logo.svg.png"import requests
r = requests.get("https://scrape.shifter.io/v1", params={ "api_key": "YOUR_API_KEY", "url": "https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/440px-Google_2015_logo.svg.png", "binary_response": 1,})print(r.json()["base64_string"][:80])import fetch from 'node-fetch';
const url = 'https://scrape.shifter.io/v1?' + new URLSearchParams({ api_key: 'YOUR_API_KEY', url: 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2f/Google_2015_logo.svg/440px-Google_2015_logo.svg.png', binary_response: '1',});const res = await fetch(url);const data = await res.json();console.log(data.base64_string.slice(0, 80));Example response
Section titled “Example response”{ "base64_string": "data:image/webp;base64,UklGRlobAABXRUJQVlA4TE4bAAA..."}See also
Section titled “See also”- Web Scraping API - endpoint hub
- Basic request