Endpoints
search()
The Search Endpoint brings the power of immersive search found on Svrf.com to your app or project. Our search engine enables your users to instantly find the immersive experience they're seeking. Content is sorted by the Svrf rating system, ensuring that the highest quality content and most relevant search results are returned first.
Declaration
func search(query: String,options: SvrfOptions,onSuccess success: @escaping (_ mediaArray: [SvrfMedia], _ nextPageNum: Int?) -> Void,onFailure failure: Optional<((_ error: SvrfError) -> Void)> = nil) -> SvrfRequest
Parameters
Parameter | Description |
---|---|
query | Url-encoded search query. |
options | Search query request options. See SvrfOptions . |
success | Success closure. |
-- mediaArray | An array of SvrfMedia from the Svrf Api. |
-- nextPageCursor | A page cursor for the next page. |
failure | Error closure. |
-- error | A SvrfError . |
Return Value
It returns SvrfRequest
handler that can be used to manage and cancel the in-flight request.
getTrending()
The Trending Endpoint provides your app or project with the hottest immersive content - curated by real humans. The experiences returned mirror the Svrf homepage, from timely cultural content to trending pop-culture references. The trending experiences are updated regularly to ensure users always get fresh updates of immersive content.
Declaration
func getTrending(options: SvrfOptions?,onSuccess success: @escaping (_ mediaArray: [SvrfMedia], _ nextPageNum: Int?) -> Void,onFailure failure: Optional<((_ error: SvrfError) -> Void)> = nil) -> SvrfRequest
Parameters
Parameter | Description |
---|---|
options | Trending request options. See SvrfOptions . |
success | Success closure. |
-- mediaArray | An array of SvrfMedia from the Svrf Api. |
-- nextPageCursor | A page cursor for the next page. |
failure | Error closure. |
-- error | A SvrfError |
Return Value
It returns SvrfRequest
handler that can be used to manage and cancel the in-flight request.
getMedia()
Fetch Svrf Media by its ID.
Declaration
unc getMedia(id: String,onSuccess success: @escaping (_ media: SvrfMedia) -> Void,onFailure failure: Optional<(_ error: SvrfError) -> Void> = nil) -> SvrfRequest
Parameters
Parameter | Description |
---|---|
id | The ID of the Media to fetch. |
success | Success closure. |
-- media | SvrfMedia from the Svrf Api. |
failure | Error closure. |
-- error | A SvrfError |
Return Value
It returns SvrfRequest
handler that can be used to manage and cancel the in-flight request.