Waifu.im API Docs
  • Introduction
  • Quick Start
  • Versioning
  • Rate Limiting
  • Tags
  • Authentication
  • Permissions
  • Authorization
  • Resources
  • Contact us
  • Reference
    • API Reference
      • Tags
      • Search
      • Favorites
      • Report
Powered by GitBook
On this page

Was this helpful?

Edit on GitHub

Versioning

To make use of our API versioning, you need to include the desired version in the Accept-Version header of your API requests. This header allows you to explicitly specify the version of the API you want to interact with, ensuring that your code remains compatible and predictable, even as newer versions become available.

If you do not specify a version, the api will use the latest available, this behaviour may break your app if breaking changes has been released.

The current version of the API is v6.

curl -X GET \
  'https://api.waifu.im/search' \
  -H 'Content-Type: application/json' \
  -H 'Accept-Version: v6'
import requests

url = 'https://api.waifu.im/search'

headers = {
    'Accept-Version': 'v6'
}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    data = response.json()
    # Process the response data as needed
else:
    print('Request failed with status code:', response.status_code)
const apiUrl = 'https://api.waifu.im/search';

const headers = new Headers();
headers.append('Accept-Version', 'v6');

fetch(apiUrl, { headers })
  .then(response => {
    if (response.ok) {
      return response.json();
    } else {
      throw new Error('Request failed with status code: ' + response.status);
    }
  })
  .then(data => {
    // Process the response data as needed
    console.log(data);
  })
  .catch(error => {
    console.error('An error occurred:', error.message);
  });
PreviousQuick StartNextRate Limiting

Last updated 11 months ago

Was this helpful?