Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Destiny2Resource

Hierarchy

Index

Constructors

constructor

Properties

Protected basePath

basePath: string

Protected httpService

httpService: HTTPService

Protected resourcePath

resourcePath: string

Methods

downloadManifest

  • downloadManifest(manifestUrl: string, filename?: string): Promise<string>
  • Download the specified manifest file, extract the zip and also deleting the zip afterwards `js import Traveler from './Traveler';

    let traveler = new Traveler({ apikey: 'apikey', userAgent: 'useragent', //used to identify your request to the API });

    traveler.destiny2 .getDestinyManifest() .then(response => { traveler.destiny2 .downloadManifest(response.Response.mobileWorldContentPaths['en']) .then(response => { console.log(response); }) .catch(err => { console.log(err); }); }) .catch(err => { console.log(err); }); `

    memberof

    Destiny2Resource

    Parameters

    • manifestUrl: string

      The url of the manifest you want to download

    • Optional filename: string

    Returns Promise<string>

    When fulfilled returns the path of the saved manifest file

downloadManifestJSON

  • downloadManifestJSON(manifestUrl: string, filename?: string): Promise<string>
  • Download the specified json manifest file

    import Traveler from './Traveler';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getDestinyManifest()
    .then(response => {
     traveler.destiny2
       .downloadManifestJSON(response.Response.jsonWorldContentPaths['en'])
       .then(response => {
         console.log(response);
        })
        .catch(err => {
          console.log(err);
        });
     })
     .catch(err => {
      console.log(err);
     });
    memberof

    Destiny2Resource

    Parameters

    • manifestUrl: string

      The url of the manifest you want to download

    • Optional filename: string

    Returns Promise<string>

    When fulfilled returns the path of the saved manifest file

getActivityHistory

  • Gets activity history stats for indicated character.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyActivityModeType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getActivityHistory(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       'characterId',
       {
         count: 10,
         mode: DestinyActivityModeType.AllPvE,
         page: 0
         })
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny membershipId of the user to retrieve.

    • characterId: string

      The id of the character to retrieve.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • count {number}: Number of rows to return
      • mode {number} A single game mode to get the history for the specified character.
        See DestinyActivityModeType for the different game mode IDs
      • page {number}: Page number to return, starting with 0

    Returns Promise<ServerResponse<DestinyActivityHistoryResults>>

getCharacter

  • Retrieve aggregrated details about a Destiny Characters

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyComponentType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getCharacter(
       BungieMembershipType.TigerPSN,
       'destinyMembershipId',
       'characterId',
       {
       components: [
         DestinyComponentType.Characters,
         DestinyComponentType.CharacterInventories,
         DestinyComponentType.CharacterProgressions,
         DestinyComponentType.CharacterRenderData,
         DestinyComponentType.CharacterActivities,
         DestinyComponentType.CharacterEquipment
       ]
    })
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      Destiny membership ID.

    • characterId: string

      ID of the character.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      You must request at least one component to receive results.
    • Optional oauthAccesstoken: string

    Returns Promise<ServerResponse<DestinyCharacterResponse>>

getClanAggregateStats

  • Gets aggregated stats for a clan using the same categories as the clan leaderboards. PREVIEW: This endpoint is still in beta, and may experience rough edges. The schema is in final form, but there may be bugs that prevent desirable operation.

    import Traveler from './Traveler';
    import { DestinyActivityModeType } from 'the-traveler/type-definitions/destiny2';
    import { StatId } from 'the-traveler/type-definitions/additions';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
     .getClanAggregateStats('groupId', {
       modes: [DestinyActivityModeType.AllPvP, DestinyActivityModeType.AllPvE]
     })
    .then(response => {
     console.log(response);
     })
     .catch(err => {
       console.log(err);
     });
    memberof

    Destiny2Resource

    Parameters

    • groupId: string

      Group ID of the clan whose leaderboards you wish to fetch.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • modes {string[]}: Array of game modes for which to get stats
        See DestinyActivityModeType for the different game mode IDs
      You must request at least one component to receive results.

    Returns Promise<ServerResponse<DestinyClanAggregateStat[]>>

getClanLeaderboards

  • Gets leaderboards with the signed in user's friends and the supplied destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and may experience rough edges. The schema is in final form, but there may be bugs that prevent desirable operation.

    import Traveler from './Traveler';
    import { DestinyActivityModeType } from 'the-traveler/type-definitions/destiny2';
    import { StatId } from 'the-traveler/type-definitions/additions';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
     .getClanLeaderboards('groupId', {
       modes: [DestinyActivityModeType.AllPvP, DestinyActivityModeType.AllPvE],
       maxtop: 10,
       statid: StatId.ActivitiesWon
     })
    .then(response => {
     console.log(response);
     })
     .catch(err => {
       console.log(err);
     });
    memberof

    Destiny2Resource

    Parameters

    • groupId: string

      Group ID of the clan whose leaderboards you wish to fetch.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • modes {strings[]} Different gameMode IDs for which to get the stats
        See DestinyActivityModeType for the different game mode IDs
      • maxtop {number}: Maximum number of top players to return. Use a large number to get entire leaderboard
      • StatIds for available ids

    Returns Promise<ServerResponse<DictionaryResponse<any>>>

    When fulfilled returns an object containing leaderboards for a clan

getClanWeeklyRewardState

  • Returns information on the weekly clan rewards and if the clan has earned them or not. Note that this will always report rewards as not redeemed.

    import Traveler from './Traveler';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', // used to identify your request to the API
    });
    
    traveler.destiny2
    .getClanWeeklyRewardState('groupId')
    .then(response => {
       console.log(response);
     })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • groupId: string

      A valid group id of the clan

    Returns Promise<ServerResponse<DestinyMilestone>>

    When fulfilled returns an object containing information about the weekly clan results

getCollectibleNodeDetails

  • Given a Presentation Node that has Collectibles as direct descendants, this will return item details about those descendants in the context of the requesting character.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyComponentType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getCollectibleNodeDetails(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       'characterId',
       1234567890,
       {components: [DestinyComponentType.Collectibles]},
       'oauthAccesstoken'
    )
    .then(response => {
      console.log(response);
    })
    .catch(err => {
      console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.PSN for this endpoint.

    • destinyMembershipId: string

      Destiny membership ID of another user. You may be denied.

    • characterId: string

      The Destiny Character ID of the character for whom we're getting collectible detail info.

    • collectiblePresentationNodeHash: number

      The hash identifier of the Presentation Node for whom we should return collectible details. Details will only be returned for collectibles that are direct descendants of this node.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      You must request at least one component to receive results.
    • oauthAccesstoken: string

    Returns Promise<ServerResponse<DestinyCollectibleNodeDetailResponse>>

    When fulfilled returns the detailed information about a Collectible Presentation Node and any Collectibles that are direct descendants.

getDestinyAggregateActivityStats

  • Gets all activities the character has participated in together with aggregate statistics for those activities.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
     .getDestinyAggregateActivityStats(
         BungieMembershipType.TigerPsn,
        'destinyMembershipId',
        'characterId'
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny membershipId of the user to retrieve.

    • characterId: string

      The specific character whose activities should be returned.

    Returns Promise<ServerResponse<DestinyAggregateActivityResults>>

getDestinyEntityDefinition

  • Returns the static definition of an entity of the given Type and hash identifier. Examine the API Documentation for the Type Names of entities that have their own definitions. Note that the return type will always inherit from DestinyDefinition, but the specific type returned will be the requested entity type if it can be found. Please don't use this as a chatty alternative to the Manifest database if you require large sets of data, but for simple and one-off accesses this should be handy.

    import Traveler from './Traveler';
    import { TypeDefinition } from 'the-traveler/type-definitions/additions';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getDestinyEntityDefinition(
       TypeDefinition.DestinyInventoryItemDefinition,
       'hashIdentifier'
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • typeDefinition: string
    • hashIdentifier: string

    Returns Promise<ServerResponse<DestinyDefinition>>

getDestinyManifest

  • Returns the current version of the manifest as a json object.

    import Traveler from './Traveler';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getDestinyManifest()
    .then(response => {
      console.log(response);
    })
    .catch(err => {
     console.log(err);
    });
    memberof

    Destiny2Resource

    Returns Promise<ServerResponse<DestinyManifest>>

    When fulfilled returns an object containing the current Destiny 2 manifest

getHistoricalStats

  • Gets historical stats for indicated character.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyStatsGroupType, PeriodType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getHistoricalStats(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       'characterId',
       {
         dayend: '2017-09-30',
         daystart: '2017-09-20',
         groups: [DestinyStatsGroupType.Activity],
         periodType: PeriodType.Activity
       }
    )
    .then(response => {
      console.log(response);
    })
    .catch(err => {
     console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny membershipId of the user to retrieve.

    • characterId: string

      The id of the character to retrieve. You can omit this character ID or set it to 0 to get aggregate stats across all characters.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • dayend {string}: Last day to return when daily stats are requested. Use the format YYYY-MM-DD
      • daystart {string}: First day to return when daily stats are requested. Use the format YYYY-MM-DD
      • groups {string[]}: Group of stats to include, otherwise only general stats are returned. Use the numbers.
        See DestinyStatsGroupType for the different IDs
      • modes {strings[]} Different gameMode IDs for which to get the stats.
        See DestinyActivityModeType for the different game mode IDs
      • periodType {number}: Indicates a specific period type to return.
        See PeriodType for the different period type numbers

    Returns Promise<ServerResponse<DictionaryResponse<DestinyHistoricalStatsByPeriod>>>

getHistoricalStatsDefinition

getHistoricalStatsForAccount

  • Gets aggregate historical stats organized around each character for a given account.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyStatsGroupType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getHistoricalStatsForAccount(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       {groups: [DestinyStatsGroupType.Activity]}
    )
    .then(response => {
      console.log(response);
    })
    .catch(err => {
     console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny membershipId of the user to retrieve.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • groups {string[]}: Group of stats to include, otherwise only general stats are returned. Use the numbers.
        / See DestinyStatsGroupType for the different IDs

    Returns Promise<ServerResponse<DestinyHistoricalStatsAccountResult>>

getItem

  • Get the details of an instanced Destiny Item. Materials and other non-instanced items can not be queried with this endpoint. The items are coupled with an specific Destiny Account

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyComponentType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getItem(
       BungieMembershipType.PSN,
       'destinyMembershipId',
       'itemInstanceId',
       { components: [DestinyComponentType.ItemCommonData] }
    )
    .then(response => {
       console.log(response);
     })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny ID (Account ID)

    • itemInstanceId: string

      ID of the Destiny Item

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      You must request at least one component to receive results.

    Returns Promise<ServerResponse<DestinyItemResponse>>

    When fulfilled returns an object containing stats about the queried item

getLeaderboards

  • Gets leaderboards with the signed in user's friends and the supplied destinyMembershipId as the focus. PREVIEW: This endpoint has not yet been implemented. It is being returned for a preview of future functionality, and for public comment/suggestion/preparation.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyActivityModeType } from 'the-traveler/type-definitions/destiny2';
    import { StatId } from 'the-traveler/type-definitions/additions';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getLeaderboards(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       {
       modes: [DestinyActivityModeType.AllPvP, DestinyActivityModeType.AllPvE],
       maxtop: 10,
       statid: StatId.ActivitiesWon
       }
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      The Destiny membershipId of the user to retrieve.

    • destinyMembershipId: string

      A valid non-BungieNet membership type.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • modes {strings[]} Different gameMode IDs for which to get the stats
        See DestinyActivityModeType for the different game mode IDs
      • maxtop {number}: Maximum number of top players to return. Use a large number to get entire leaderboard
      • See StatIds for available ids
      You must request at least one component to receive results.

    Returns Promise<ServerResponse<DictionaryResponse<any>>>

getLeaderboardsForCharacter

  • Gets leaderboards with the signed in user's friends and the supplied destinyMembershipId as the focus. PREVIEW: This endpoint is still in beta, and may experience rough edges. The schema is in final form, but there may be bugs that prevent desirable operation.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyActivityModeType } from 'the-traveler/type-definitions/destiny2';
    import { StatId } from 'the-traveler/type-definitions/additions';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getLeaderboardsForCharacter(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       'characterId',
       {
       modes: [DestinyActivityModeType.AllPvP, DestinyActivityModeType.AllPvE],
       maxtop: 10,
       statid: StatId.ActivitiesWon
       }
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny membershipId of the user to retrieve.

    • characterId: string

      The specific character to build the leaderboard around for the provided Destiny Membership.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • modes {strings[]} Different gameMode IDs for which to get the stats
        See DestinyActivityModeType for the different game mode IDs
      • maxtop {number}: Maximum number of top players to return. Use a large number to get entire leaderboard
      • //TODO: Change the link of all enums See StatIds for available ids
      You must request at least one component to receive results.

    Returns Promise<ServerResponse<DictionaryResponse<any>>>

getLinkedProfiles

  • Returns a summary information about all profiles linked to the requesting membership type/membership ID that have valid Destiny information. The passed-in Membership Type/Membership ID may be a Bungie.Net membership or a Destiny membership. It only returns the minimal amount of data to begin making more substantive requests, but will hopefully serve as a useful alternative to UserServices for people who just care about Destiny data. Note that it will only return linked accounts whose linkages you are allowed to view.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getLinkedProfiles(
       BungieMembershipType.TigerPSN,
       'destinyMembershipId'
    );
    .then(response => {
     console.log(response);
    })
    .catch(err => {
     console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    Returns Promise<ServerResponse<DestinyLinkedProfilesResponse>>

getPostGameCarnageReport

  • Gets the available post game carnage report for the activity ID.

    import Traveler from './Traveler';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
     traveler.destiny2
     .getPostGameCarnageReport('activityId')
     .then(response => {
       console.log(response);
     })
     .catch(err => {
       console.log(err);
     });
    memberof

    Destiny2Resource

    Parameters

    • activityId: string

      The ID of the activity whose PGCR is requested.

    Returns Promise<ServerResponse<DestinyPostGameCarnageReportData>>

    When fulfilled returns an object containing the carnage report for the specified activity

getProfile

  • Returns Destiny Profile information for the supplied membership.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyComponentType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getProfile(
       BungieMembershipType.TigerPsn,
       'membershipId',
       {components: [DestinyComponentType.Profiles]}
    )
    .then(response => {
     console.log(response);
    })
    .catch(err => {
     console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny ID (Account ID)

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      You must request at least one component to receive results.
    • Optional oauthAccesstoken: string

    Returns Promise<ServerResponse<DestinyProfileResponse>>

getPublicMilestoneContent

  • Gets custom localized content for the milestone of the given hash, if it exists.

    import Traveler from './Traveler';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
     .getPublicMilestoneContent(
        'milestoneHash'
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • milestoneHash: string

      The identifier for the milestone to be returned.

    Returns Promise<ServerResponse<DestinyMilestoneContent>>

getPublicMilestones

  • Gets public information about currently available Milestones. `js import Traveler from './Traveler';

    let traveler = new Traveler({ apikey: 'apikey', userAgent: 'useragent', //used to identify your request to the API });

    traveler.destiny2 .getPublicMilestones() .then(response => { console.log(response); }) .catch(err => { console.log(err); }); `

    memberof

    Destiny2Resource

    Returns Promise<ServerResponse<DictionaryResponse<DestinyPublicMilestone>>>

getPublicVendors

  • Get items available from vendors where the vendors have items for sale that are common for everyone. If any portion of the Vendor's available inventory is character or account specific, we will be unable to return their data from this endpoint due to the way that available inventory is computed. As I am often guilty of saying: 'It's a long story...'

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyComponentType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getPublicVendors(
       {
         components: [DestinyComponentType.Vendors]
       }
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      You must request at least one component to receive results.

    Returns Promise<ServerResponse<DestinyVendorsResponse>>

    When fulfilled returns an object containing all valid components for the public Vendors endpoint

getUniqueWeaponHistory

  • Gets details about unique weapon usage, including all exotic weapons.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
     .getUniqueWeaponHistory(
         BungieMembershipType.TigerPsn,
        'destinyMembershipId',
        'characterId'
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      The Destiny membershipId of the user to retrieve.

    • characterId: string

      The id of the character to retrieve.

    Returns Promise<ServerResponse<DestinyHistoricalWeaponStatsData>>

getVendor

  • Get the details of a specific Vendor.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyComponentType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2.
    .getVendor(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       'characterId',
       'vendorHash'
       {
         components: [DestinyComponentType.VendorReceipts,  DestinyComponentType.VendorSales]
       },
       'oauthAccesstoken'
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      Destiny membership ID of another user. You may be denied.

    • characterId: string

      The Destiny Character ID of the character for whom we're getting vendor info.

    • vendorHash: string

      The Hash identifier of the Vendor to be returned.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      You must request at least one component to receive results.
    • oauthAccesstoken: string

    Returns Promise<ServerResponse<DestinyVendorResponse>>

getVendors

  • Get currently available vendors from the list of vendors that can possibly have rotating inventory. Note that this does not include things like preview vendors and vendors-as-kiosks, neither of whom have rotating/dynamic inventories. Use their definitions as-is for those.

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    import { DestinyComponentType } from 'the-traveler/type-definitions/destiny2';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .getVendors(
       BungieMembershipType.TigerPsn,
       'destinyMembershipId',
       'characterId',
       {
         components: [DestinyComponentType.VendorReceipts]
       },
       'oauthAccesstoken'
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • destinyMembershipId: string

      Destiny membership ID of another user. You may be denied.

    • characterId: string

      The Destiny Character ID of the character for whom we're getting vendor info.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      You must request at least one component to receive results.
    • oauthAccesstoken: string

    Returns Promise<ServerResponse<DestinyVendorsResponse>>

    When fulfilled returns an object containing all available vendors

searchDestinyEntities

  • Gets a page list of Destiny items.

    import Traveler from './Traveler';
    import { TypeDefinition } from 'the-traveler/type-definitions/additions';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .searchDestinyEntities(
       'moon',
       TypeDefinition.DestinyInventoryItemDefinition,
       { page: 0 })
    .then(response => {
     console.log(response);
    })
    .catch(err => {
     console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • searchTerm: string

      The string to use when searching for Destiny entities.

    • typeDefinition: TypeDefinition

      The type of entity for whom you would like results. These correspond to the entity's definition contract name. For instance, if you are looking for items, this property should be 'DestinyInventoryItemDefinition'.

    • queryStringParameters: QueryStringParameters

      An object containing key/value query parameters for this endpoint. Following keys are valid:

      • page {number} Page number to return, starting with 0

    Returns Promise<ServerResponse<DestinyEntitySearchResult>>

    The entities search result

searchDestinyPlayer

  • Search for a Destiny 2 player by name

    import Traveler from './Traveler';
    import { BungieMembershipType } from 'the-traveler/type-definitions/app';
    
    let traveler = new Traveler({
     apikey: 'apikey',
     userAgent: 'useragent', //used to identify your request to the API
    });
    
    traveler.destiny2
    .searchDestinyPlayer(
       BungieMembershipType.All,
       'displayName'
    )
    .then(response => {
       console.log(response);
    })
    .catch(err => {
       console.log(err);
    });
    memberof

    Destiny2Resource

    Parameters

    • membershipType: BungieMembershipType

      A valid non-BungieNet membership type. It has to match the type which the destinyMembershipId is belonging to.
      Keep in mind that -1 / MembershipType.All is not applicable here
      Ex: If the destinyMembershipId is a PSN account then use '2' or MembershipType.TigerPSN for this endpoint.

    • displayName: string

      The full gamertag or PSN id of the player. Spaces and case are ignored

    Returns Promise<ServerResponse<UserInfoCard[]>>