This document provides a comprehensive analysis of Scryfall search functionality and compares the current Scryfall OS implementation against the official Scryfall API. Recent testing shows excellent implementation quality, with both APIs achieving 100% success rates and only minor data synchronization differences. The core search engine demonstrates excellent stability and accuracy with comprehensive feature coverage for most common use cases.
- Functionality Mapping: Analyzed official Scryfall syntax documentation and current codebase
- API Comparison: Automated testing comparing official Scryfall API vs local implementation
- Gap Analysis: Identified missing or incomplete features based on current implementation
Based on the codebase analysis and successful API comparisons:
-
Basic Search
name:- Card name searchesoracle:oro:- Oracle text searchestype:ort:- Type line searches
-
Numeric Attributes
cmc:- Converted mana costpower:orpow:- Creature powertoughness:ortou:- Creature toughness
-
Colors and Identity
color:orc:- Card colors (JSONB object)identity:orid:- Color identity (JSONB object)
-
Set and Collection Data ✅ Recently Implemented
set:ors:- Set codes with exact matchingrarity:orr:- Card rarity with integer-based orderingnumber:orcn:- Collector numbers
-
Format Legality ✅ Recently Implemented
format:orf:- Format legalitylegal:- Legal in specific formatbanned:- Banned in specific formatrestricted:- Restricted in specific format
-
Pricing Data ✅ Recently Implemented
usd:- USD prices with all comparison operatorseur:- EUR prices with all comparison operatorstix:- MTGO ticket prices with all comparison operators
-
Artist Search ✅ Recently Implemented
artist:ora:- Artist names with trigram indexing
-
Advanced Features
keywords:ork:- Keyword abilities (JSONB object)oracle_tags:orot:- Oracle tags
-
Visual Properties ✅ Recently Implemented
watermark:- Card watermarks
-
Temporal Features ✅ Recently Implemented
date:- Specific release date filtering with all comparison operatorsyear:- Release year filtering with optimized date range queries
-
Operators
- Comparison:
=,<,>,<=,>=,!=,<> - Logic:
AND,OR,NOT,-(negation) - Arithmetic:
+,-,*,/(e.g.,cmc+1<power) - Grouping:
()parentheses
- Comparison:
-
Card Types
subtypes:- Implemented as JSONB array- Status: Works but may have data completeness issues
-
Mana Costs
mana:- Both JSONB object and text representations available- Status: Implementation exists but may have minor comparison discrepancies
Based on official Scryfall documentation and current implementation gaps:
- Advanced Mechanics
devotion:- Mana symbol devotion counting
-
Advanced Mechanics
loyalty:- Planeswalker loyalty countersdevotion:- Mana symbol devotion counting
-
Collection and Game Features
cube:- Cube inclusion statuscommander:orcmd:- Commander format specificspapersets:- Paper set availability
-
Complex Search Patterns
- Regular expressions:
/pattern/syntax
- Regular expressions:
-
Meta Properties
is:booster- Available in booster packsis:spotlight- Featured spotlight cards- Various specialized game properties
- Official API success rate: 100% (21/21)
- Local API success rate: 100% (21/21)
- Major discrepancies: 4.8% (1/21)
-
Excellent Server Stability
- Local API (scryfall.crestcourt.com) running consistently reliably
- No server errors or timeouts during comprehensive testing
- Both APIs achieving perfect 100% success rates
-
Dramatic Improvement in Data Quality
- Major discrepancies reduced to just 4.8% of queries (1 out of 21)
- Position correlation excellent across most queries (0.98-1.00)
- Most result count differences now small and manageable (typically 1-55 cards)
-
Remaining Issues Resolved
- Previous
keyword:flyingmajor discrepancy resolved (now 2796 vs 2779, difference of 17) - Data completeness significantly improved across all query types
- Previous
-
Current Data Quality Status
- Small result count differences remain (1-257 cards typically)
- Variations likely due to database refresh timing and card edition differences
Recent comprehensive testing (21 queries) shows the following performance characteristics:
Queries with Perfect Match:
llanowar- 25/25 cards, correlation 1.00name:"Lightning Bolt"- 1/1 cards, correlation 1.00power<0- 2/2 cards, correlation 1.00
Queries with Minor Differences (1-55 cards):
lightning- 63 vs 61 cards (-2), correlation 0.98t:beast- 516 vs 513 cards (-3), correlation 1.00c:g- 5845 vs 5820 cards (-25), correlation 1.00cmc=3- 6943 vs 6888 cards (-55), correlation 1.00power>3- 3932 vs 3898 cards (-34), correlation 1.00
Queries with Moderate Differences (125-257 cards):
id:g- 6828 vs 6571 cards (-257), correlation 0.99cmc=0- 1169 vs 1044 cards (-125), correlation 0.99
-
Data Synchronization Monitoring
- Continue monitoring small result count differences (typically 1-257 cards)
- Maintain card database currency with latest Scryfall bulk data
- Implement automated incremental update processes
-
Quality Assurance Enhancement
- Expand automated test coverage beyond current test suite
- Add regression testing for critical features
- Implement continuous monitoring of API comparison results
- Advanced Mechanics 🎯
- Implement
devotion:support for mana symbol devotion counting
- Implement
-
Advanced Mechanics Support
loyalty:counter tracking for planeswalkersdevotion:calculation capabilities
-
Collection and Meta Features
cube:inclusion tracking- Commander format specific features (
cmd:) - Paper availability tracking (
papersets:)
-
Advanced Search Patterns
- Regular expression support (
/pattern/)
- Regular expression support (
-
Specialized Game Properties
- Booster pack availability tracking
- Spotlight and featured card properties
- Alchemy-Only Features
spellpower:- Spell power (Alchemy format only)spellresistance:- Spell resistance (Alchemy format only)- Rationale: These features are specific to Magic: The Gathering Arena's Alchemy format and are not relevant for traditional paper Magic or other formats that Scryfall OS targets.
-
Automated Comparison Suite ✅
- Comprehensive test suite with ongoing API comparison monitoring
- Automated reporting and discrepancy detection working effectively
- Performance benchmarking and response time monitoring in place
-
Implementation Validation ✅
- 339 total tests including 209 comprehensive parser tests
- Current API success rate: 100% for all supported features
- Excellent data quality with regular comparison against official Scryfall API
- Official API success rate: 100% (consistent performance)
- Local API success rate: 100% (excellent stability)
- Major discrepancies: Minimal (primarily minor data sync differences)
- Position correlation: Excellent (0.98-1.00 across most queries)
-
Comprehensive Feature Coverage
- All core search functionality working reliably
- Advanced features like rarity comparisons, pricing, and format legality fully operational
- Excellent stability across text search, numeric comparisons, and complex queries
-
Data Quality Excellence
- Minor result count differences only (typically 1-257 cards)
- Strong correlation in result ordering and relevance
- Consistent behavior across different query types and complexities
-
Performance and Reliability
- Local API achieving 100% uptime during testing
- Fast response times with optimized PostgreSQL backend
- Proper indexing including integer-based rarity comparisons
The Scryfall OS project has achieved excellent maturity and feature completeness for core Magic: The Gathering card search functionality. With comprehensive support for basic search, advanced querying, pricing data, format legality, and specialized features like Oracle tags, the system provides robust coverage of most common use cases.
Major Achievements:
- ✅ Complete core search functionality (name, oracle, type, numeric attributes)
- ✅ Advanced features (rarity, pricing, legality, artist search)
- ✅ Excellent API stability and data quality (100% success rates)
- ✅ Comprehensive test coverage (339 tests including 209 parser tests)
- ✅ Performance optimization with proper database indexing
Current Focus Areas:
- Ongoing data synchronization improvements and monitoring
- Implementation of advanced mechanics (
devotion:) - Enhanced specialized features for advanced users
The automated comparison framework provides excellent ongoing quality assurance capabilities, and the system is well-positioned for continued feature development while maintaining high stability and accuracy standards.