Skip to main content

Universal Search API

makeUniversalSearch

A call to this function will make a universal search across the PlayStation Network for your search query. Each search query requires a domain, such as "SocialAllAccounts".

note

If you search for your own username, it will not be in the list of results. This is a quirk of the universal search API. In cases where you want to use the accountId of the account that's currently logged in, use "me" instead of the standard account ID value.

Examples

Find a user's accountId by their username

import { makeUniversalSearch } from "psn-api";

const response = await makeUniversalSearch(
authorization,
"xelnia",
"SocialAllAccounts"
);

Returns

NameTypeDescription
prefixstring
suggestionsstring[]
fallbackQueriedboolean
domainResponsesany[]

Parameters

NameTypeDescription
authorizationAuthorizationPayloadAn object that must contain an accessToken. See this page for how to get one.
searchTermstringThe value being searched for.
domainstringWhat kind of value is being searched for, such as SocialAllAccounts.

Source

search/makeUniversalSearch.ts