@yaelouuu/fortnite-api 4.3.0 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -345,6 +345,127 @@ const psnAuth = await client.account.getExternalAuth('accountId123', 'psn');
345
345
 
346
346
  ---
347
347
 
348
+ ### News - **NEW**
349
+
350
+ Get Fortnite news and announcements for all game modes.
351
+
352
+ ```typescript
353
+ // Get Battle Royale news
354
+ const brNews = await client.news.getBRNews();
355
+ // Returns: MOTDs, platform messages, images, and videos
356
+
357
+ // Get Save The World news
358
+ const stwNews = await client.news.getSTWNews();
359
+
360
+ // Get Creative news
361
+ const creativeNews = await client.news.getCreativeNews();
362
+
363
+ // Get all news at once
364
+ const allNews = await client.news.getAllNews();
365
+ // Returns: { br, stw, creative, lastModified }
366
+ ```
367
+
368
+ ---
369
+
370
+ ### Cosmetics - **NEW**
371
+
372
+ Browse and search the complete Fortnite cosmetics catalog.
373
+
374
+ #### Get All Cosmetics
375
+ ```typescript
376
+ const cosmetics = await client.cosmetics.getAll({
377
+ page: 1,
378
+ pageSize: 50,
379
+ type: 'outfit', // outfit, backpack, pickaxe, glider, emote, wrap, music, etc.
380
+ rarity: 'legendary', // common, uncommon, rare, epic, legendary, mythic
381
+ set: 'Dark Series'
382
+ });
383
+ // Returns: Paginated list with item details
384
+ ```
385
+
386
+ #### Get Cosmetic by ID
387
+ ```typescript
388
+ const item = await client.cosmetics.getById('CID_123_Athena');
389
+ // Returns: Detailed cosmetic information
390
+ ```
391
+
392
+ #### Search Cosmetics
393
+ ```typescript
394
+ const results = await client.cosmetics.search('galaxy', {
395
+ page: 1,
396
+ pageSize: 20,
397
+ type: 'outfit'
398
+ });
399
+ // Search by name or description
400
+ ```
401
+
402
+ #### Get New Cosmetics
403
+ ```typescript
404
+ const newItems = await client.cosmetics.getNew({
405
+ page: 1,
406
+ pageSize: 50
407
+ });
408
+ // Returns: Recently added cosmetics
409
+ ```
410
+
411
+ ---
412
+
413
+ ### Crew - **NEW**
414
+
415
+ Fortnite Crew subscription pack information.
416
+
417
+ ```typescript
418
+ // Get current month's Crew Pack
419
+ const current = await client.crew.getCurrent();
420
+ // Returns: Current crew pack with cosmetics and details
421
+
422
+ // Get Crew Pack history
423
+ const history = await client.crew.getHistory();
424
+ // Returns: All previous crew packs
425
+ ```
426
+
427
+ ---
428
+
429
+ ### Map - **NEW**
430
+
431
+ Current and historical Fortnite map data.
432
+
433
+ ```typescript
434
+ // Get current map with POIs
435
+ const map = await client.map.getCurrent();
436
+ // Returns: Map data with points of interest
437
+
438
+ // Get map image URL
439
+ const mapImage = await client.map.getImage();
440
+ // Returns: Current map image URL
441
+
442
+ // Get historical map data
443
+ const history = await client.map.getHistory();
444
+ // Returns: Previous map versions
445
+ ```
446
+
447
+ ---
448
+
449
+ ### Playlists - **NEW**
450
+
451
+ Fortnite playlists and game modes.
452
+
453
+ ```typescript
454
+ // Get all playlists
455
+ const allPlaylists = await client.playlists.getAll();
456
+ // Returns: All game modes and playlists
457
+
458
+ // Get active playlists only
459
+ const active = await client.playlists.getActive();
460
+ // Returns: Currently available playlists
461
+
462
+ // Get specific playlist
463
+ const playlist = await client.playlists.getById('Playlist_DefaultSolo');
464
+ // Returns: Detailed playlist information
465
+ ```
466
+
467
+ ---
468
+
348
469
  ### FN (Fortnite Game) - **NEW**
349
470
 
350
471
  Fortnite-specific game data including inventory, features, and settings.
@@ -497,6 +618,32 @@ MIT
497
618
 
498
619
  ## 🆕 Changelog
499
620
 
621
+ ### v4.3.0 (2026-01-08)
622
+ - ✨ **NEW** `NewsResource` with 4 methods:
623
+ - Battle Royale news
624
+ - Save The World news
625
+ - Creative news
626
+ - All news in one call
627
+ - ✨ **NEW** `CosmeticsResource` with 4 methods:
628
+ - Browse all cosmetics with filters (type, rarity, set)
629
+ - Search cosmetics by name
630
+ - Get cosmetic by ID
631
+ - Get newly added cosmetics
632
+ - ✨ **NEW** `CrewResource` with 2 methods:
633
+ - Current Crew Pack
634
+ - Crew Pack history
635
+ - ✨ **NEW** `MapResource` with 3 methods:
636
+ - Current map with POIs
637
+ - Map image URL
638
+ - Historical map data
639
+ - ✨ **NEW** `PlaylistsResource` with 3 methods:
640
+ - All playlists/game modes
641
+ - Active playlists only
642
+ - Specific playlist by ID
643
+ - 📝 Comprehensive TypeScript types for all new endpoints
644
+ - 🎯 Complete SDK coverage for all API endpoints
645
+ - ✅ 100% backward compatible
646
+
500
647
  ### v4.2.0 (2026-01-06)
501
648
  - ✨ **NEW** `AccountResource` with 8 methods:
502
649
  - Account lookups by ID, display name, and external platforms
package/dist/client.d.ts CHANGED
@@ -13,6 +13,11 @@ import { FNResource } from "./resources/fn";
13
13
  import { FriendsResource } from "./resources/friends";
14
14
  import { StatsResource } from "./resources/stats";
15
15
  import { EventsResource } from "./resources/events";
16
+ import { NewsResource } from "./resources/news";
17
+ import { CosmeticsResource } from "./resources/cosmetics";
18
+ import { CrewResource } from "./resources/crew";
19
+ import { MapResource } from "./resources/map";
20
+ import { PlaylistsResource } from "./resources/playlists";
16
21
  export interface ClientOptions {
17
22
  apiKey: string;
18
23
  baseUrl?: string;
@@ -35,6 +40,11 @@ export declare class FortniteAPI {
35
40
  friends: FriendsResource;
36
41
  stats: StatsResource;
37
42
  events: EventsResource;
43
+ news: NewsResource;
44
+ cosmetics: CosmeticsResource;
45
+ crew: CrewResource;
46
+ map: MapResource;
47
+ playlists: PlaylistsResource;
38
48
  constructor(options: ClientOptions);
39
49
  /**
40
50
  * Internal method to make HTTP requests
package/dist/client.js CHANGED
@@ -17,6 +17,11 @@ const fn_1 = require("./resources/fn");
17
17
  const friends_1 = require("./resources/friends");
18
18
  const stats_1 = require("./resources/stats");
19
19
  const events_1 = require("./resources/events");
20
+ const news_1 = require("./resources/news");
21
+ const cosmetics_1 = require("./resources/cosmetics");
22
+ const crew_1 = require("./resources/crew");
23
+ const map_1 = require("./resources/map");
24
+ const playlists_1 = require("./resources/playlists");
20
25
  class FortniteAPI {
21
26
  constructor(options) {
22
27
  this.apiKey = options.apiKey;
@@ -38,6 +43,11 @@ class FortniteAPI {
38
43
  this.friends = new friends_1.FriendsResource(this);
39
44
  this.stats = new stats_1.StatsResource(this);
40
45
  this.events = new events_1.EventsResource(this);
46
+ this.news = new news_1.NewsResource(this);
47
+ this.cosmetics = new cosmetics_1.CosmeticsResource(this);
48
+ this.crew = new crew_1.CrewResource(this);
49
+ this.map = new map_1.MapResource(this);
50
+ this.playlists = new playlists_1.PlaylistsResource(this);
41
51
  }
42
52
  /**
43
53
  * Internal method to make HTTP requests
@@ -0,0 +1,25 @@
1
+ import { FortniteAPI } from "../client";
2
+ import { CosmeticsResponse, CosmeticItem, CosmeticsPaginatedResponse, CosmeticsSearchParams } from "../types";
3
+ export declare class CosmeticsResource {
4
+ private client;
5
+ constructor(client: FortniteAPI);
6
+ /**
7
+ * Get all cosmetics with pagination and filters
8
+ */
9
+ getAll(params?: CosmeticsSearchParams): Promise<CosmeticsPaginatedResponse>;
10
+ /**
11
+ * Get a specific cosmetic by ID
12
+ */
13
+ getById(id: string): Promise<CosmeticsResponse<CosmeticItem>>;
14
+ /**
15
+ * Search cosmetics by name or description
16
+ */
17
+ search(query: string, params?: Omit<CosmeticsSearchParams, 'search'>): Promise<CosmeticsPaginatedResponse>;
18
+ /**
19
+ * Get recently added cosmetics
20
+ */
21
+ getNew(params?: {
22
+ page?: number;
23
+ pageSize?: number;
24
+ }): Promise<CosmeticsPaginatedResponse>;
25
+ }
@@ -0,0 +1,67 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CosmeticsResource = void 0;
4
+ class CosmeticsResource {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Get all cosmetics with pagination and filters
10
+ */
11
+ async getAll(params) {
12
+ const queryParams = new URLSearchParams();
13
+ if (params?.page)
14
+ queryParams.set("page", params.page.toString());
15
+ if (params?.pageSize)
16
+ queryParams.set("pageSize", params.pageSize.toString());
17
+ if (params?.type)
18
+ queryParams.set("type", params.type);
19
+ if (params?.rarity)
20
+ queryParams.set("rarity", params.rarity);
21
+ if (params?.set)
22
+ queryParams.set("set", params.set);
23
+ if (params?.search)
24
+ queryParams.set("search", params.search);
25
+ const query = queryParams.toString();
26
+ const endpoint = query ? `/cosmetics/all?${query}` : "/cosmetics/all";
27
+ return this.client.request(endpoint);
28
+ }
29
+ /**
30
+ * Get a specific cosmetic by ID
31
+ */
32
+ async getById(id) {
33
+ return this.client.request(`/cosmetics/${id}`);
34
+ }
35
+ /**
36
+ * Search cosmetics by name or description
37
+ */
38
+ async search(query, params) {
39
+ const queryParams = new URLSearchParams();
40
+ queryParams.set("q", query);
41
+ if (params?.page)
42
+ queryParams.set("page", params.page.toString());
43
+ if (params?.pageSize)
44
+ queryParams.set("pageSize", params.pageSize.toString());
45
+ if (params?.type)
46
+ queryParams.set("type", params.type);
47
+ if (params?.rarity)
48
+ queryParams.set("rarity", params.rarity);
49
+ if (params?.set)
50
+ queryParams.set("set", params.set);
51
+ return this.client.request(`/cosmetics/search?${queryParams.toString()}`);
52
+ }
53
+ /**
54
+ * Get recently added cosmetics
55
+ */
56
+ async getNew(params) {
57
+ const queryParams = new URLSearchParams();
58
+ if (params?.page)
59
+ queryParams.set("page", params.page.toString());
60
+ if (params?.pageSize)
61
+ queryParams.set("pageSize", params.pageSize.toString());
62
+ const query = queryParams.toString();
63
+ const endpoint = query ? `/cosmetics/new?${query}` : "/cosmetics/new";
64
+ return this.client.request(endpoint);
65
+ }
66
+ }
67
+ exports.CosmeticsResource = CosmeticsResource;
@@ -0,0 +1,14 @@
1
+ import { FortniteAPI } from "../client";
2
+ import { CrewPackResponse, CrewHistoryResponse } from "../types";
3
+ export declare class CrewResource {
4
+ private client;
5
+ constructor(client: FortniteAPI);
6
+ /**
7
+ * Get current month's Crew Pack
8
+ */
9
+ getCurrent(): Promise<CrewPackResponse>;
10
+ /**
11
+ * Get Crew Pack history
12
+ */
13
+ getHistory(): Promise<CrewHistoryResponse>;
14
+ }
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CrewResource = void 0;
4
+ class CrewResource {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Get current month's Crew Pack
10
+ */
11
+ async getCurrent() {
12
+ return this.client.request("/crew/current");
13
+ }
14
+ /**
15
+ * Get Crew Pack history
16
+ */
17
+ async getHistory() {
18
+ return this.client.request("/crew/history");
19
+ }
20
+ }
21
+ exports.CrewResource = CrewResource;
@@ -0,0 +1,18 @@
1
+ import { FortniteAPI } from "../client";
2
+ import { MapResponse, MapImageResponse, MapHistoryResponse } from "../types";
3
+ export declare class MapResource {
4
+ private client;
5
+ constructor(client: FortniteAPI);
6
+ /**
7
+ * Get current Fortnite map with POIs
8
+ */
9
+ getCurrent(): Promise<MapResponse>;
10
+ /**
11
+ * Get current map image URL
12
+ */
13
+ getImage(): Promise<MapImageResponse>;
14
+ /**
15
+ * Get historical map data
16
+ */
17
+ getHistory(): Promise<MapHistoryResponse>;
18
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MapResource = void 0;
4
+ class MapResource {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Get current Fortnite map with POIs
10
+ */
11
+ async getCurrent() {
12
+ return this.client.request("/map");
13
+ }
14
+ /**
15
+ * Get current map image URL
16
+ */
17
+ async getImage() {
18
+ return this.client.request("/map/image");
19
+ }
20
+ /**
21
+ * Get historical map data
22
+ */
23
+ async getHistory() {
24
+ return this.client.request("/map/history");
25
+ }
26
+ }
27
+ exports.MapResource = MapResource;
@@ -0,0 +1,22 @@
1
+ import { FortniteAPI } from "../client";
2
+ import { NewsResponse, BRNews, STWNews, CreativeNews, AllNews } from "../types";
3
+ export declare class NewsResource {
4
+ private client;
5
+ constructor(client: FortniteAPI);
6
+ /**
7
+ * Get Battle Royale news
8
+ */
9
+ getBRNews(): Promise<NewsResponse<BRNews>>;
10
+ /**
11
+ * Get Save The World news
12
+ */
13
+ getSTWNews(): Promise<NewsResponse<STWNews>>;
14
+ /**
15
+ * Get Creative news
16
+ */
17
+ getCreativeNews(): Promise<NewsResponse<CreativeNews>>;
18
+ /**
19
+ * Get all news (BR, STW, Creative)
20
+ */
21
+ getAllNews(): Promise<NewsResponse<AllNews>>;
22
+ }
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.NewsResource = void 0;
4
+ class NewsResource {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Get Battle Royale news
10
+ */
11
+ async getBRNews() {
12
+ return this.client.request("/news/br");
13
+ }
14
+ /**
15
+ * Get Save The World news
16
+ */
17
+ async getSTWNews() {
18
+ return this.client.request("/news/stw");
19
+ }
20
+ /**
21
+ * Get Creative news
22
+ */
23
+ async getCreativeNews() {
24
+ return this.client.request("/news/creative");
25
+ }
26
+ /**
27
+ * Get all news (BR, STW, Creative)
28
+ */
29
+ async getAllNews() {
30
+ return this.client.request("/news");
31
+ }
32
+ }
33
+ exports.NewsResource = NewsResource;
@@ -0,0 +1,18 @@
1
+ import { FortniteAPI } from "../client";
2
+ import { PlaylistsResponse, ActivePlaylistsResponse, PlaylistResponse } from "../types";
3
+ export declare class PlaylistsResource {
4
+ private client;
5
+ constructor(client: FortniteAPI);
6
+ /**
7
+ * Get all Fortnite playlists/gamemodes
8
+ */
9
+ getAll(): Promise<PlaylistsResponse>;
10
+ /**
11
+ * Get currently active playlists/gamemodes
12
+ */
13
+ getActive(): Promise<ActivePlaylistsResponse>;
14
+ /**
15
+ * Get a specific playlist by ID
16
+ */
17
+ getById(playlistId: string): Promise<PlaylistResponse>;
18
+ }
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PlaylistsResource = void 0;
4
+ class PlaylistsResource {
5
+ constructor(client) {
6
+ this.client = client;
7
+ }
8
+ /**
9
+ * Get all Fortnite playlists/gamemodes
10
+ */
11
+ async getAll() {
12
+ return this.client.request("/playlists", {}, "v2");
13
+ }
14
+ /**
15
+ * Get currently active playlists/gamemodes
16
+ */
17
+ async getActive() {
18
+ return this.client.request("/playlists/active", {}, "v2");
19
+ }
20
+ /**
21
+ * Get a specific playlist by ID
22
+ */
23
+ async getById(playlistId) {
24
+ return this.client.request(`/playlists/${playlistId}`, {}, "v2");
25
+ }
26
+ }
27
+ exports.PlaylistsResource = PlaylistsResource;
@@ -17,6 +17,9 @@ export declare class TournamentsResource {
17
17
  * Get global events with metadata
18
18
  */
19
19
  getGlobal(): Promise<any>;
20
+ getSessions(params: {
21
+ eventId: string;
22
+ }): Promise<any>;
20
23
  /**
21
24
  * Download events for a specific account
22
25
  * Requires user's own Fortnite token
@@ -25,6 +25,10 @@ class TournamentsResource {
25
25
  async getGlobal() {
26
26
  return this.client.request("/events/global");
27
27
  }
28
+ async getSessions(params) {
29
+ const { eventId } = params;
30
+ return this.client.request(`/events/sessions?eventId=${eventId}`);
31
+ }
28
32
  /**
29
33
  * Download events for a specific account
30
34
  * Requires user's own Fortnite token
@@ -497,3 +497,150 @@ export interface EventRewards {
497
497
  currency?: string;
498
498
  }>;
499
499
  }
500
+ export interface NewsResponse<T> {
501
+ status: number;
502
+ data: T;
503
+ }
504
+ export interface MOTD {
505
+ id: string;
506
+ title: string;
507
+ body: string;
508
+ image: string;
509
+ tileImage?: string;
510
+ videoURL?: string;
511
+ [key: string]: any;
512
+ }
513
+ export interface BRNews {
514
+ motds: MOTD[];
515
+ platform_motds?: MOTD[];
516
+ [key: string]: any;
517
+ }
518
+ export interface STWNews {
519
+ motds: MOTD[];
520
+ [key: string]: any;
521
+ }
522
+ export interface CreativeNews {
523
+ motds: MOTD[];
524
+ [key: string]: any;
525
+ }
526
+ export interface AllNews {
527
+ br: BRNews;
528
+ stw: STWNews;
529
+ creative: CreativeNews;
530
+ lastModified: string;
531
+ }
532
+ export interface CosmeticsResponse<T> {
533
+ status: number;
534
+ data: T;
535
+ }
536
+ export interface CosmeticsPaginatedResponse {
537
+ status: number;
538
+ data: CosmeticItem[];
539
+ pagination: {
540
+ page: number;
541
+ pageSize: number;
542
+ total: number;
543
+ totalPages: number;
544
+ };
545
+ }
546
+ export interface CosmeticItem {
547
+ id: string;
548
+ name: string;
549
+ description?: string;
550
+ type: string;
551
+ rarity: string;
552
+ series?: string;
553
+ set?: string;
554
+ images?: {
555
+ icon?: string;
556
+ featured?: string;
557
+ [key: string]: any;
558
+ };
559
+ introduction?: {
560
+ season?: number;
561
+ chapter?: number;
562
+ };
563
+ [key: string]: any;
564
+ }
565
+ export interface CosmeticsSearchParams {
566
+ page?: number;
567
+ pageSize?: number;
568
+ type?: string;
569
+ rarity?: string;
570
+ set?: string;
571
+ search?: string;
572
+ }
573
+ export interface CrewPackResponse {
574
+ status: number;
575
+ data: {
576
+ crew: {
577
+ name: string;
578
+ catalogEntries: any[];
579
+ refreshIntervalHrs: number;
580
+ dailyPurchaseHrs: number;
581
+ } | null;
582
+ count: number;
583
+ message: string;
584
+ lastModified: string;
585
+ };
586
+ }
587
+ export interface CrewHistoryResponse {
588
+ status: number;
589
+ data: {
590
+ history: any[];
591
+ count: number;
592
+ message: string;
593
+ lastModified: string;
594
+ };
595
+ }
596
+ export interface MapResponse {
597
+ status: number;
598
+ data: {
599
+ [key: string]: any;
600
+ };
601
+ }
602
+ export interface MapImageResponse {
603
+ status: number;
604
+ data: {
605
+ [key: string]: any;
606
+ };
607
+ }
608
+ export interface MapHistoryResponse {
609
+ status: number;
610
+ data: {
611
+ [key: string]: any;
612
+ };
613
+ }
614
+ export interface PlaylistsResponse {
615
+ status: number;
616
+ data: {
617
+ playlists: {
618
+ [playlistId: string]: Playlist;
619
+ };
620
+ conversion_config: any;
621
+ lastModified: string;
622
+ };
623
+ }
624
+ export interface ActivePlaylistsResponse {
625
+ status: number;
626
+ data: {
627
+ playlists: {
628
+ [playlistId: string]: Playlist;
629
+ };
630
+ count: number;
631
+ lastModified: string;
632
+ };
633
+ }
634
+ export interface PlaylistResponse {
635
+ status: number;
636
+ data: Playlist;
637
+ }
638
+ export interface Playlist {
639
+ id: string;
640
+ image: string;
641
+ playlist_name: string;
642
+ hidden: boolean;
643
+ _type: string;
644
+ lastModified?: string;
645
+ [key: string]: any;
646
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yaelouuu/fortnite-api",
3
- "version": "4.3.0",
3
+ "version": "4.5.0",
4
4
  "description": "SDK for Fortnite Tournaments API by Royal Arena - Author : Yael Brinkert",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",