Svrf – Face Filters
MediaIntroduction to SVRF Public APIs
SVRF is a platform that offers an extensive library of 3D and Augmented Reality (AR) assets, such as images and filters, that developers can incorporate into their applications. These assets can be utilized to create immersive experiences that can engage users with cutting-edge technology.
The SVRF platform offers APIs that allow developers to access the platform's vast library of assets directly. In this article, we'll explore how to use the APIs, and provide example code written in JavaScript.
Getting Started
Before leveraging the API, developers need to register an account on the SVRF Developer Portal. Once registered, you will be provided with an access key that you can utilize to make requests to the APIs.
SVRF currently provides 3 public APIs:
- Search API
- Random API
- Trending API
Search API
This API allows developers to search for specific images or filters by keyword. Searching for assets can be done by calling the following API endpoint:
https://api.svrf.com/v1/search?query={query}&type={type}&category={category}
Here's an example code snippet that demonstrates how to use the Search API to search for all the filter and image assets related to the keyword "cat."
const fetch = require('node-fetch');
fetch(`https://api.svrf.com/v1/search?query=cat&type=model,filter`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error))
Random API
This API allows developers to fetch a random filter or image assets. Making a call to the Random API is a simple HTTP GET request:
https://api.svrf.com/v1/random?type={type}&category={category}
Here's a code snippet that shows how to implement the Random API to access a random image:
const fetch = require('node-fetch');
fetch(`https://api.svrf.com/v1/random?type=image`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error))
Trending API
This API allows developers to fetch assets that are currently trending on the SVRF platform. To receive a list of images and filters that are currently popular, you can call the following API endpoint:
https://api.svrf.com/v1/trending?id={id}&type={type}&category={category}
To make an HTTP GET request with the Trending API, you could use the following code:
const fetch = require('node-fetch');
fetch(`https://api.svrf.com/v1/trending?type=image,filter`)
.then(response => response.json())
.then(data => console.log(data))
.catch(error => console.error(error))
Conclusion
In conclusion, the APIs that SVRF provides offers developers more flexibility and control over the assets that can be incorporated into their applications. The combination of powerful APIs and multiple use cases can help create immersive AR experiences. With the example code included in this article, developers can make the most out of the SVRF public APIs, and start creating their own AR experiences hassle-free.