₹0.00

No products in the cart.

₹0.00

No products in the cart.

HomeAPIAPI | Random Doge Image Generator API

API | Random Doge Image Generator API

Random doge Image Generator API is a free API that you can do it anywhere for free, this API works on GET requests. If you request, you will get JSON output in response, which you can use in your project. It is straightforward, you can use it in an easy way in languages like Javascript, Php, Python, etc. Javascript random dog image API,

How To Use Random Doge Image API

Random Doge Photo Generator API EndPoint

GET https://random.dog/woof.json

Random dog picture generator API is very easy to use, you will get an endpoint, and simply you have to make a GET request on it.

Only one image may be sent per request. The following image content types are supported Dog API free:

  • image/jpeg
  • image/png
  • image/gif
  • image/tiff

Animated gifs are supported. Use your power for good.

The response is an Image object within a data envelope. Example response The Dog API:

{ "fileSizeBytes": 122289, "url": "https://random.dog/6d07c332-b2b3-418e-a3ab-bb189e4bb899.jpg" }

How To Use Random Dog Image API

For PHP

<?php    $curl = curl_init();    curl_setopt_array($curl, [    CURLOPT_URL => "https://random.dog/woof.json",    CURLOPT_RETURNTRANSFER => true,    CURLOPT_ENCODING => "",    CURLOPT_MAXREDIRS => 10,    CURLOPT_TIMEOUT => 30,    CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,    CURLOPT_CUSTOMREQUEST => "GET",  ]);    $response = curl_exec($curl);  $err = curl_error($curl);    curl_close($curl);    if ($err) {    echo "cURL Error #:" . $err;  } else {    echo $response;  }

JavaScript

const options = {method: 'GET'};    fetch('https://random.dog/woof.json', options)    .then(response => response.json())    .then(response => console.log(response))    .catch(err => console.error(err));

Python

import requests    url = "https://random.dog/woof.json"    response = requests.request("GET", url)    print(response.text)

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest news

Median UI v1.7 + (AMP) Premium Blogger Template Download

Hello and welcome to TechnoStone. In this post, I will be introducing you to the Median UI v1.7 Blogger Template. Median UI v1.7 is a...

Plus UI V2.6.1 Blogger Template with Safelink Free Download

Hey there! In this post, I want to tell you about a really cool blogger template called Plus UI. It's a premium design that's...

Litespot v2.0 – [Premium] Blogger Template Free Download

LiteSpot v2.0 Blogger Template: The Ultimate Theme for News Sites and Magazines LiteSpot v2.0 Blogger Template, which is a professional and SEO-friendly theme for creating...

FROM SHOP