Get-APITCGProduct

SYNOPSIS

List products (cards, sealed, accessories) / Get a product by ID

SYNTAX

Index (Default)

Get-APITCGProduct [-Type <string>] [-Tcg <string>] [-Set <string>] [-Serie <string>]
 [-Name <string>] [-Code <string>] [-UpdatedSince <datetime>] [-AfterId <long>]
 [-NarutoStatus <string>] [-IncludeSuperseded] [-Populate <string[]>] [-Limit <int>] [-Page <int>]
 [-SortBy <string>] [-SortOrder <string>] [-AllResults] [-Raw]

ById

Get-APITCGProduct [-Id] <long> [-Populate <string[]>] [-Raw]

ALIASES

This cmdlet has the following aliases,

  • None

DESCRIPTION

Parameter set [ Index ] - The Get-APITCGProduct cmdlet invokes the GET method of the /api/products endpoint (List products (cards, sealed, accessories))

Returns products with combinable filters. ‘name’ matches any part of the name; if nothing matches, a fuzzy fallback search kicks in and the response includes ‘fallback: true’.

The ‘tcg’ and ‘set’ references always come back as full documents - you do not need ‘populate’ for them.

Examples

  • Search cards by name:

    GET /api/products?tcg=one-piece&name=luffy

  • Search Pokemon cards by their name in another language (‘alias’):

    GET /api/products?tcg=pokemon&name=bramaluna

  • Search by card code:

    GET /api/products?code=OP03-070

  • Naruto Card Game cards already on the market (not the previews):

    GET /api/products?tcg=naruto-card-game&narutoStatus=released

  • Cards of a TCG with pagination and sorting:

    GET /api/products?tcg=pokemon&type=card&name=charizard&limit=50&page=2

  • Sealed products of a TCG (their description travels in ‘attributes.Description’):

    GET /api/products?tcg=riftbound&type=sealed

  • The illustrator of a card is in ‘attributes.Artist’, when the game publishes it:

    GET /api/products?tcg=lorcana&type=card&name=elsa

  • Full catalog sync with the cursor (send the last ‘_id’ as ‘afterId’):

    GET /api/products?tcg=pokemon&sortBy=_id&sortOrder=asc&limit=100&afterId=0

See Product attributes for what ‘attributes’ carries and Prices for ‘markets’.

Parameter set [ ById ] - The Get-APITCGProduct cmdlet invokes the GET method of the /api/products/{id} endpoint (Get a product by ID)

Returns a product by its numeric (auto-incremental) ‘_id’.

Use -AllResults to request every page of the results. Large result sets are paged with a cursor (sorted by _id, using the afterId parameter) which is the recommended way to copy a large part of the catalog. Use -UpdatedSince to only get the products that changed since your last sync. The items can be piped to Get-APITCGHistoryPrice

EXAMPLES

EXAMPLE 1

Get-APITCGProduct

Returns the result of the /api/products endpoint

EXAMPLE 2

Get-APITCGProduct -Tcg 'one-piece' -Type 'card' -Page 2 -Limit 10

Returns the second page of 10 items from the /api/products endpoint

EXAMPLE 3

Get-APITCGProduct -Tcg 'one-piece' -Type 'card' -AllResults

Returns every item from the /api/products endpoint by requesting every page of the results with a cursor

EXAMPLE 4

Get-APITCGProduct -Id 9804

Returns the result of the /api/products/{id} endpoint

EXAMPLE 5

Get-APITCGProduct -Tcg 'one-piece' -Name 'luffy'

Searches the One Piece products for a name that contains luffy

EXAMPLE 6

Get-APITCGProduct -Code 'OP03-070'

Searches the products of every trading card game for the exact card code

EXAMPLE 7

Get-APITCGProduct -Tcg 'naruto-card-game' -NarutoStatus 'released'

Returns the Naruto Card Game cards that are on the market (not the previews)

EXAMPLE 8

Get-APITCGProduct -UpdatedSince (Get-Date).AddDays(-7) -AllResults

Returns every product that changed in the last 7 days, paged with a cursor

EXAMPLE 9

Get-APITCGProduct -Tcg 'pokemon' -Name 'charizard' | Get-APITCGHistoryPrice -Limit 30

Returns the last 30 price records of every Charizard product

PARAMETERS

-AfterId

Cursor for full syncs: only products whose ‘_id’ is greater than this value. Use it with ‘sortBy=_id&sortOrder=asc’ and send the last ‘_id’ you received. In cursor mode ‘total’ comes back as ‘null’. See Syncing the whole catalog.

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-AllResults

Returns all items from the endpoint by requesting every page of the results

The results are paged with a cursor (sorted by _id, using the afterId parameter), which is the recommended way to copy a large part of the catalog -SortBy & -SortOrder can not be used with a different value than _id & asc. The first request starts at -AfterId (default 0), or at -Page when it is used

Each request counts against the monthly request quota of the API key, up to 100 items are returned per request

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Code

Exact card code, case-sensitive (e.g. ‘OP03-070’).

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Id

Numeric product ID.

Type: System.Int64
DefaultValue: 0
SupportsWildcards: false
Aliases:
- _id
ParameterSets:
- Name: ById
  Position: 0
  IsRequired: true
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: true
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-IncludeSuperseded

(Naruto Card Game) Also list the previews already replaced by their market product (‘catalogSupersededBy’), which are left out by default. Accepts ‘true’ or ‘false’.

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Limit

Maximum number of results to return (1-100).

Default value: 25

Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Name

Search by name. It matches text ignoring case and uses a fuzzy fallback when there are no matches. For Pokemon, Magic, Yu-Gi-Oh! and searches across all games, it also searches alias, ignores accents and accepts words in any order.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-NarutoStatus

(Naruto Card Game) Only the cards in this state: ‘released’ (on the market), ‘demo’, ‘artwork-preview’ or ‘announced’. Any other value returns ‘400’. See Naruto Card Game.

Allowed values: ‘released’, ‘demo’, ‘artwork-preview’, ‘announced’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Page

Results page to show.

Default value: 1

Type: System.Int32
DefaultValue: 0
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Populate

Comma-separated references to include as full documents. Allowed values: ‘tcg’, ‘set’, ‘serie’. ‘tcg’ and ‘set’ already come populated by default, so in practice you only need this for ‘serie’.

Allowed values: ‘tcg’, ‘set’, ‘serie’

Type: System.String[]
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: ById
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Raw

Returns the full API response (success, data, total, & fallback) instead of only the data

Type: System.Management.Automation.SwitchParameter
DefaultValue: False
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: (All)
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Serie

Filter by series (series ID). Series are not in use in the current catalog.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Set

Filter by set: the set ‘_id’ (e.g. ‘one-piece-pillars-of-strength’), as returned by ‘/api/{tcg}/sets’.

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SortBy

Field to sort the results by.

Default value: name

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-SortOrder

Sort direction.

Default value: asc

Allowed values: ‘asc’, ‘desc’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Tcg

Filter by TCG (slug - see the list of available TCGs).

Any value is accepted so that new values keep working, tab completion suggests the known values: ‘cardfight-vanguard’, ‘cyberpunk’, ‘digimon’, ‘dragon-ball-super-fusion-world’, ‘dragon-ball-super-masters’, ‘final-fantasy-tcg’, ‘flesh-and-blood’, ‘gundam’, ‘hololive’, ‘lorcana’, ‘magic’, ‘mitos-y-leyendas’, ‘my-little-pony-tcg’, ‘naruto-card-game’, ‘one-piece’, ‘palworld’, ‘pokemon’, ‘riftbound’, ‘star-wars-unlimited’, ‘union-arena’, ‘yugioh’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-Type

Filter by product type. The catalog currently holds ‘card’ and ‘sealed’ products.

Allowed values: ‘card’, ‘sealed’, ‘accessory’, ‘other’

Type: System.String
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

-UpdatedSince

Only products updated since this date (ISO 8601). Combine it with ‘afterId’ to sync only what changed.

The date is converted to UTC & sent in the format yyyy-MM-ddTHH:mm:ssZ

Type: System.DateTime
DefaultValue: ''
SupportsWildcards: false
Aliases: []
ParameterSets:
- Name: Index
  Position: Named
  IsRequired: false
  ValueFromPipeline: false
  ValueFromPipelineByPropertyName: false
  ValueFromRemainingArguments: false
DontShow: false
AcceptedValues: []
HelpMessage: ''

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

INPUTS

System.Int64

OUTPUTS

NOTES

Endpoint : GET /api/products Endpoint : GET /api/products/{id}