Dogs API

The Dogs API provides detailed, qualitative information on over 200 different breeds of dogs.

/v1/dogs

HTTP GET

Get a list of dog breeds matching specified parameters. Returns at most 20 results. To access more than 20 results, use the offset parameter to offset results in multiple API calls.

Parameters

At least one of the following parameters (excluding offset) is required.

name (optional) - the name of breed.

min_height (optional) - minimum height in inches.

max_height (optional) - maximum height in inches.

min_weight (optional) - minimum weight in pounds.

max_weight (optional) - maximum weight in pounds.

min_life_expectancy (optional) - minimum life expectancy in years.

max_life_expectancy (optional) - maximum life expectancy in years.

shedding (optional) - How much hair the breed sheds. Possible values: 1, 2, 3, 4, 5, where 1 indicates no shedding and 5 indicates maximum shedding.

barking (optional) - How vocal the breed is. Possible values: 1, 2, 3, 4, 5, where 1 indicates minimal barking and 5 indicates maximum barking.

energy (optional) - How much energy the breed has. Possible values: 1, 2, 3, 4, 5, where 1 indicates low energy and 5 indicates high energy.

protectiveness (optional) - How likely the breed is to alert strangers. Possible values: 1, 2, 3, 4, 5, where 1 indicates minimal alerting and 5 indicates maximum alerting.

trainability (optional) - How easy it is to train the breed. Possible values: 1, 2, 3, 4, 5, where 1 indicates the breed is very difficult to train and 5 indicates the breed is very easy to train.

offset (optional) - number of results to offset for pagination.

Headers

X-Api-Key (required) - API Key associated with your account.

Sample Request URL

Live Demo!

https://api.api-ninjas.com/v1/dogs?name=

Sample Response

[
  {
    "image_link": "https://api-ninjas.com/images/dogs/golden_retriever.jpg",
    "good_with_children": 5,
    "good_with_other_dogs": 5,
    "shedding": 4,
    "grooming": 2,
    "drooling": 2,
    "coat_length": 1,
    "good_with_strangers": 5,
    "playfulness": 4,
    "protectiveness": 3,
    "trainability": 5,
    "energy": 3,
    "barking": 1,
    "min_life_expectancy": 10,
    "max_life_expectancy": 12,
    "max_height_male": 24,
    "max_height_female": 24,
    "max_weight_male": 75,
    "max_weight_female": 65,
    "min_height_male": 23,
    "min_height_female": 23,
    "min_weight_male": 65,
    "min_weight_female": 55,
    "name": "Golden Retriever"
  }
]

import requests
name = 'golden retriever'
api_url = 'https://api.api-ninjas.com/v1/dogs?name={}'.format(name)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
    print(response.text)
else:
    print("Error:", response.status_code, response.text)
var name = 'golden retriever'
$.ajax({
    method: 'GET',
    url: 'https://api.api-ninjas.com/v1/dogs?name=' + name,
    headers: { 'X-Api-Key': 'YOUR_API_KEY'},
    contentType: 'application/json',
    success: function(result) {
        console.log(result);
    },
    error: function ajaxError(jqXHR) {
        console.error('Error: ', jqXHR.responseText);
    }
});
const request = require('request');
var name = 'golden retriever';
request.get({
  url: 'https://api.api-ninjas.com/v1/dogs?name=' + name,
  headers: {
    'X-Api-Key': 'YOUR_API_KEY'
  },
}, function(error, response, body) {
  if(error) return console.error('Request failed:', error);
  else if(response.statusCode != 200) return console.error('Error:', response.statusCode, body.toString('utf8'));
  else console.log(body)
});
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;

import com.fasterxml.jackson.databind.ObjectMapper;

URL url = new URL("https://api.api-ninjas.com/v1/dogs?name=golden retriever");
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("accept", "application/json");
InputStream responseStream = connection.getInputStream();
ObjectMapper mapper = new ObjectMapper();
JsonNode root = mapper.readTree(responseStream);
System.out.println(root.path("fact").asText());
let name = "golden retriever".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowed)
let url = URL(string: "https://api.api-ninjas.com/v1/dogs?name="+name!)!
var request = URLRequest(url: url)
request.setValue("YOUR_API_KEY", forHTTPHeaderField: "X-Api-Key")
let task = URLSession.shared.dataTask(with: request) {(data, response, error) in
    guard let data = data else { return }
    print(String(data: data, encoding: .utf8)!)
}
task.resume()
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.