npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

archidekt

v0.0.14

Published

archidekt api

Downloads

18

Readme

Archidekt

Archidekt is a deck building website for the popular trading card game (TCG) Magic: the Gathering (MtG). The repository is not affiliated with or supported by Archidekt and users of this code base are responsible for following best practices

API (official)

At the moment Archidekt does not have documentation for their API and is currently in open beta. Therefore everything seen here in is open to change.

decks

The base URI for searching Archidekt for a deck by https://archidekt.com/api/decks/(id)/ and has the following parameters:

id

the integer corresponding to the deck's ID

  • example: https://archidekt.com/api/decks/56723/

small

trailing slug to minifiy results

  • example https://archidekt.com/api/decks/56723/small/

Search

The base URI for searching Archidekt for decks is https://archidekt.com/api/decks/cards/ and has the following parameters:

name

search for decks with a given name. This is case insensitive and returns decks that match the substring. To get decks with any name leave blank i.e. name=

  • required: true
  • default: name=
  • expects: non quoted string
  • values: empty or string
  • example: name=dark angel (would return a deck titled "Dark Angels Rising")

colors

color identity of the deck.

  • required: false
  • default: colors=White,Blue,Black,Green,Red,Colorless
  • expects: comma separated list of not quoted colors
  • values: White, Blue, Black, Green, Red, Colorless
  • example: colors=Blue,Black

logicalAnd

whether or not colors identity should be inclusive (all colors listed) or partial (any of the colors listed). Logical or is indicated by the exclusion of this field.

  • required: false
  • default: ``
  • expects: boolean
  • values: true
  • example andcolors=true

owner

search via the username who made the deck. Will match substrings

  • required: false
  • default: ``
  • expects: non quoted string
  • values: string
  • example owner=sumneur will return decks by sumneuron

cards

search for decks including any of the cards listed.

  • required: false
  • default: ``
  • expects: url escaped comma separated list of quoted strings corresponding to valid card names in English
  • values: string
  • example cards="Legion's Landing // Adanto, the First Fort","Ral, Storm Conduit" will return decks containing either "Legion's Landing // Adanto, the First Fort" or Ral, Storm Conduit

orderBy

the field on which to sort matching results.

  • required: false,
  • default: orderBy=-createdAt
  • expects: a non quoted string (possibly proceeded by a -) indicating the field on which to sort
  • values: string
  • example: orderBy=owner

formats

the set of formats of which returned decks should adhere to supported formats currently included

1:  Standard
2:  Modern
3:  Commander / EDH
4:  Legacy
5:  Vintage
6:  Pauper
7:  Custom
8:  Frontier
9:  Future Standard
10: Penny Dreadful
11: 1v1 Commander
12: Dual Commander
13: Brawl
  • required: false
  • default: ``
  • expects: a comma separated list of integers in the domain [1,13] corresponding to the formats
  • values: 1,2,3,4,5,6,7,8,9,10,11,12,13
  • example" formats=1,2 (standard / modern decks)

commanders

the commanders that should lead the deck. Note: this will be applied on formats that do not have commanders! Note: this will match exclusively (only returns decks with all listed cards as commanders)

  • required: false
  • default: ``
  • expects: url escaped comma separated list of quoted strings corresponding to valid card names in English
  • values: string
  • example commanders="Eight-and-a-Half-Tails" will return decks containing "Eight-and-a-Half-Tails" as a commander.

pageSize

how many decks to return per page. Note: excluding this field will return all decks

  • required: false
  • default: pageSize=50
  • expects: integer
  • values: positive integer
  • example" pageSize=100

Examples

Decks

To help clarify the logic of Archidekt's api we use the following decks to test combinations

Strombreaker

This deck is of format=7 (custom), includes the card "Ral, Storm Conduit", has the color identity Red,Blue and was made by user sumneuron.

Examples

1
&andcolors=true
&cards="Legion's Landing // Adanto, the First Fort","Ral, Storm Conduit"
&colors=White,Blue,Black,Green,Red,Colorless
&owner=sumneur

Will not return the deck "Stormbreaker" which does not included the card Legion's Landing // Adanto, the First Fort.

2

&cards="Legion's Landing // Adanto, the First Fort","Ral, Storm Conduit"
&colors=White,Blue,Black,Green,Red,Colorless
&owner=sumneur

Will return the deck "Stormbreaker" which does not included the card Legion's Landing // Adanto, the First Fort.

API (this code base)

import archidekt from 'archidekt'


// axios instance with base url `https://archidekt.com/api/`
archidekt.api

// axios get request for the given id. See "decks" above
archidekt.fetchDeckById(id, small=true)

// axios get request searching for decks with given parameters
archidekt.searchDecks(
  {
    logicalAnd=false,
    owner=null,
    colors=['White', 'Blue', 'Black', 'Green', 'Red', 'Colorless'],
    cards=null,
    orderBy='createdAt',
    descending=true,
    formats=null,
    pageSize=10,
    commanders=null
  }
)