RandomFox

Animals API · Random fox images · Cute & simple · No auth

TL;DR

RandomFox is the simplest way to get random fox photos in your application. One endpoint, zero configuration, instant fox. The API returns JSON with an image URL, or you can get the image directly. It's perfect for nature apps, educational projects, or any time you need a fox.

Quick start: https://randomfox.ca/floof/

No API key needed — just make a request!

How to Use This API

1. Random Fox — JSON Response

https://randomfox.ca/floof/

Returns JSON: {"image":"https://randomfox.ca/images/42.jpg","link":"https://randomfox.ca/42/"}

2. Direct Image

https://randomfox.ca/images/42.jpg

Use the image URL directly from the JSON response to embed in <img> tags.

3. Specific Fox by ID

https://randomfox.ca/?i=7

Fetch a specific fox image by its ID number. The API has a collection of fox photos indexed by number.

4. JavaScript — Fox Display

async function showRandomFox() {
  const resp = await fetch('https://randomfox.ca/floof/');
  const data = await resp.json();
  
  const img = document.getElementById('fox-image');
  if (img) {
    img.src = data.image;
    img.alt = 'Random fox';
    img.style = 'max-width:500px;border-radius:10px;box-shadow:0 2px 8px rgba(0,0,0,0.2);';
  }
}

// Call on page load or button click
document.addEventListener('DOMContentLoaded', showRandomFox);
// Or: <button onclick="showRandomFox()">New Fox!</button>
5. Python — Multiple Foxes
import requests

def get_multiple_foxes(count=3):
    foxes = []
    for _ in range(count):
        resp = requests.get('https://randomfox.ca/floof/')
        foxes.append(resp.json()['image'])
    return foxes

def save_foxes():
    urls = get_multiple_foxes(3)
    for i, url in enumerate(urls):
        img = requests.get(url)
        filename = f'fox_{i+1}.jpg'
        with open(filename, 'wb') as f:
            f.write(img.content)
        print(f'Saved {filename}')
    
save_foxes()
Try a random fox: https://randomfox.ca/floof/

Frequently Asked Questions

How many fox images are available?
The collection has over 100 unique fox photos covering red foxes, arctic foxes, fennec foxes, and gray foxes in various poses and settings.
Can I get a fox by ID?
Yes! Use https://randomfox.ca/?i=42 to get fox number 42 specifically. The available IDs range from 1 to the total count.
What image format is used?
JPEG format — all images are high-quality fox photos.
Are there rate limits?
RandomFox is a free community resource with no documented rate limits. Be respectful and cache images if you need many.
Can I use these images commercially?
The images are sourced from various photographers. Check each image's license if using commercially. For personal/hobby projects, usage is generally fine.

API Details

API URL
https://randomfox.ca
Documentation
randomfox.ca
Category
Animals
Authentication
Not Required
Geographic Coverage
Global

What You Can Build