Svrf API Docs

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

ParameterDescription
queryUrl-encoded search query.
optionsSearch query request options. See SvrfOptions.
successSuccess closure.
-- mediaArrayAn array of SvrfMedia from the Svrf Api.
-- nextPageCursorA page cursor for the next page.
failureError closure.
-- errorA 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

ParameterDescription
optionsTrending request options. See SvrfOptions.
successSuccess closure.
-- mediaArrayAn array of SvrfMedia from the Svrf Api.
-- nextPageCursorA page cursor for the next page.
failureError closure.
-- errorA 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

ParameterDescription
idThe ID of the Media to fetch.
successSuccess closure.
-- mediaSvrfMedia from the Svrf Api.
failureError closure.
-- errorA SvrfError

Return Value

It returns SvrfRequest handler that can be used to manage and cancel the in-flight request.