Skip to content

Search

Search Service File Structure

  • DirectorySNAPCASTER-BACKEND
    • Directoryservices
      • Directorysearch
        • Directorydependencies
          • auth.py
          • db_client.py
        • Directoryroutes
          • search.py
        • .gitignore
        • Dockerfile
        • main.py
        • requirements.txt

GET /health


Returns a health object which makes sure that the search service is able to connect to the Mongo database.

  1. HTTP 200 OK | message: Service is running, num_docs:[#]
  2. HTTP 500 Internal Server Error | message: Service is down, error:[Exception e]

Health Check Object

PropertyTypeDetails
messageStringDetails about service status
num_docsStringNumber of documents in the shopify and crystal commerce collections

GET /sets


Returns a list of Sets Objects.

  1. HTTP 200 OK | List[Sets Object]
  2. HTTP 500 Internal Server Error | message: sets endpoint is down

Sets Object

PropertyTypeDetails
nameStringThe set name
abbreviationStringThe set code abbreviation

GET /websites


Returns a list of Websites Objects.

  1. HTTP 200 OK | Websites Object
  2. HTTP 500 Internal Server Error | message: websites endpoint is down

Websites Object

PropertyTypeDetails
slugStringStore Slug
nameStringStore Name
urlStringStore URL
tcgsList[String]TCG’s supported

POST /advanced


Returns a list of Advanced Objects.

  1. HTTP 200 OK | List[Advanced Object]
  2. HTTP 401 Unauthorized | Subscription Required

Advanced Object

PropertyTypeDetails
nameStringThe card name
setStringThe set the card belongs to
priceDoubleThe cost of the card
foilStringThe type of foil of the card (e.g. Regular Foil, Etched Foil, Galaxy Foil, etc).
conditionStringThe card condition
imageStringThe original image URL from the website scraped
linkStringThe link to the product
websiteStringThe local game store name
frameStringThe type of framing of the card (e.g. Extended, Borderless, Full Art, etc.).
alternate_artBooleanSpecify if the card is a alternate art card
alternate_art_japaneseBooleanSpecify if the card is a japanese alternate art card
showcaseStringThe Showcase treatment of the card (e.g. Anime, Sketch, Ring Frame, etc).
promoStringSpecify if the card is a promo card
promo_packStringSpecify if the card is a promo pack card
promo_prereleaseStringSpecify if the card is a promo pre-release card
art_seriesBooleanSpecify if the card is a art series card
golden_stamped_art_seriesBooleanSpecify if the card is a alternate art card

Advanced Parameters

PropertyTypeMandatoryDetails
cardNameStringMandatoryThe card name
websiteList[String]A list of Local Game Stores
conditionList[String]A list of acceptable conditions
foilList[String]A list of foil treatments
showcaseTreatmentList[String]A list of showcase treatments
frameList[String]A list of card frame types
setList[String]A list of different MTG card sets to query based on
preReleaseBooleanSpecify if the card is a pre-release card
promoBooleanSpecify if the card is a promo card
alternate_artBooleanSpecify if the card is a alternate art card
alternate_art_japaneseBooleanSpecify if the card is a japanese alternate art card
art_seriesBooleanSpecify if the card is a art series card
golden_stamped_art_seriesBooleanSpecify if the card is a gold stamped series card (This implies that it’s also an art series card)