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.
import requestsurl ='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 neededelse:print('Request failed with status code:', response.status_code)
constapiUrl='https://api.waifu.im/search';constheaders=newHeaders();headers.append('Accept-Version','v6');fetch(apiUrl, { headers }).then(response => {if (response.ok) {returnresponse.json(); } else {thrownewError('Request failed with status code: '+response.status); } }).then(data => {// Process the response data as neededconsole.log(data); }).catch(error => {console.error('An error occurred:',error.message); });