IbSearch API v1.x

Requests are performed on this kind of URL:

https://ibsear.ch/api/v1/function.format?parameters
function One of supported API functions: images (query image database), tags (tag database and statistics), sites (indexed boorus and galleries)
format One of: json, xml or html (use only for testing).
parameters URL-encoded set of request parameters specific to the function.

Requests without API key can be done once in 3 seconds from one IP.

Requests with (free) API key can be done each second per IP.

You can get your own key here. This key will also let you see some useful statistics.

Ways to pass the API key

Via X-IbSearch-Key
This is the best way: use extra header with your API key as its value (40 symbols). Since it's not part of the URL it has better chances to not be logged anywhere.
Via HTTP Basic Auth
Equally good. You can split your key in 2 parts and pass one as username and another as password. It doesn't matter how you split. Any part can be empty.
Via POST or GET
Most convenient but most obvious method as well. Use key variable to pass your key directly on the URL.

Examples

X-IbSearch-Key

Using command-line curl:

curl -HX-IbSearch-Key:yourkeygoeshere https://ibsear.ch/api/v1/images?q=2girls

Using PHP's curl:

$curl = curl_init('https://ibsear.ch/api/v1/images?q=2girls');
curl_setopt($curl, CURLOPT_HTTPHEADER, array('X-IbSearch-Key: yourkeygoeshere'));
curl_exec($curl);
curl_close($curl);

Using native PHP streams:

$header = array('X-IbSearch-Key: yourkeygoeshere');
$context = stream_context_create(array('http' => compact('header')));
echo file_get_contents('https://ibsear.ch/api/v1/images?q=2girls', false, $context);

HTTP Auth

If your API key is e4f31cb4dc01824495f6697d723abc10897dd7b3 then you can split it like this (or in any other similar way):

part1 part2
e4f31cb4dc01824495f6 697d723abc10897dd7b3
e4f31cb4dc018 24495f6697d723abc10897dd7b3
e4f31cb4dc01824495f6697d723abc10897dd7b3
e4f31cb4dc01824495f6697d723abc10897dd7b3

Using command-line curl:

curl https://part1:part2@ibsear.ch/api/v1/images?q=2girls

Using PHP's curl:

$curl = curl_init('https://ibsear.ch/api/v1/images?q=2girls', false, $context);
curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
curl_setopt($curl, CURLOPT_USERPWD, 'part1:part2');
curl_exec($curl);
curl_close($curl);

Using native PHP streams you need to construct the header manually as there is no convenient option for doing this:

$header = array('Authorization: Basic '.base64_encode('part1:part2'));
$context = stream_context_create(array('http' => compact('header')));
echo file_get_contents('https://ibsear.ch/api/v1/images?q=2girls', false, $context);

POST data

Using command-line curl:

curl -dkey=yourkeygoeshere https://ibsear.ch/api/v1/images?q=2girls

Using PHP's curl:

$curl = curl_init('https://ibsear.ch/api/v1/images?q=2girls');
curl_setopt($curl, CURLOPT_POSTFIELDS, array('key' => 'yourkeygoeshere'));
curl_exec($curl);
curl_close($curl);

Using native PHP streams:

$context = stream_context_create(array('http' => array(
  'method'    => 'POST',
  'header'    => 'Content-Type: application/x-www-form-urlencoded',
  'content'   => 'key=yourkeygoeshere',
)));

echo file_get_contents('https://ibsear.ch/api/v1/images?q=2girls', false, $context);

GET query string

Obviously, you only have to edit your URL and use any method to do the request.

https://ibsear.ch/api/v1/images?q=2girls&key=yourkeygoeshere
Scroll to top