What is data normalization?
Data normalization automatically converts provider-specific response formats into a consistent, unified schema. This eliminates the need to write provider-specific parsing logic or handle format variations across different data sources. Use data normalization when you need:- Consistent data formats regardless of provider
- Zero provider-specific parsing logic
- Seamless provider switching without code changes
- Predictable data structures across all endpoints
Data normalization is enabled by default for all Uniblock users. All responses
follow the same schema regardless of underlying provider.
How it works
Different providers return blockchain data in different formats. Uniblock normalizes all responses into a consistent schema:- Provider response - Raw data received from blockchain provider
- Schema mapping - Uniblock maps provider fields to unified schema
- Type conversion - Converts data types (string/number/formatted)
- Field enrichment - Adds missing fields with computed values
- Unified response - Returns consistent format to your application
Normalization examples
Token balances
Different providers return token balances in incompatible formats:| Provider | Balance format | Decimals | Formatted value |
|---|---|---|---|
| Alchemy | "1000000000" (string) | Separate field | Not included |
| Moralis | 1000000000 (number) | Separate field | Not included |
| Covalent | "1000.00" (formatted) | Included in value | Already formatted |
Transaction timestamps
Providers use different timestamp formats:| Provider | Timestamp format | Example |
|---|---|---|
| Alchemy | Unix timestamp (seconds) | 1640995200 |
| Moralis | ISO 8601 string | "2022-01-01T00:00:00Z" |
| Covalent | Unix timestamp (milliseconds) | 1640995200000 |
NFT metadata
NFT metadata structures vary significantly across providers: Alchemy format:Real-world scenarios
Scenario 1: Multi-provider portfolio tracker
Challenge: Building a portfolio tracker that aggregates data from multiple providers, each with different response formats. Without normalization:Scenario 3: NFT marketplace integration
Challenge: Displaying NFT collections from multiple providers with consistent metadata. Request:Normalized field types
Uniblock ensures consistent data types across all providers:Address fields
Always returned as:- Checksummed Ethereum addresses
- Lowercase for consistency in comparisons
- Validated format
Numeric values
Always returned as:- String for large numbers (prevents precision loss)
- Formatted decimal version included
- Original decimals preserved
Timestamps
Always returned as:- Unix timestamp (seconds)
- ISO 8601 string
- Block number for reference
Boolean values
Always returned as:- Native boolean type (not strings)
- Consistent naming (isActive, hasMetadata)
Key benefits
Zero parsing logic
No provider-specific code needed. Single schema works everywhere.
Seamless provider switching
Switch providers without changing your application code.
Type safety
Consistent data types prevent runtime errors and type mismatches.
Reduced development time
Build faster without handling format variations across providers.
Field mapping reference
Common provider field variations and their normalized equivalents:| Data type | Provider variations | Uniblock normalized |
|---|---|---|
| Token balance | tokenBalance, balance, value | balance |
| Decimals | decimals, decimal, token_decimal | decimals |
| Contract address | contract, token_address, contractAddress | contractAddress |
| Token ID | tokenId, token_id, id.tokenId | tokenId |
| Transaction hash | hash, tx_hash, transactionHash | hash |
| Block number | blockNumber, block_number, block | blockNumber |
| Timestamp | timestamp, block_timestamp, timeStamp | timestamp |
| Gas used | gasUsed, gas_used, gas | gasUsed |
| NFT image | image, image_url, metadata.image | image, imageUrl |
| NFT attributes | attributes, traits, metadata.attributes | attributes |
Handling edge cases
Uniblock normalization handles common edge cases automatically:Null and missing values
Provider behavior:- Some providers return
null - Others omit the field entirely
- Some return empty strings
IPFS URLs
Provider behavior:- Some return
ipfs://URIs - Others return gateway URLs
- Some return raw CIDs
Large numbers
Provider behavior:- Some return numbers (lose precision for large values)
- Others return strings
- Some return scientific notation
Case sensitivity
Provider behavior:- Some use camelCase
- Others use snake_case
- Some use PascalCase
Best practices
Use normalized fields directly - Don’t re-parse or transform normalized
responses. They’re already in optimal format.
Rely on formatted values - Use
balanceFormatted, valueFormatted for
display instead of manual formatting.Trust type consistency - Normalized responses have consistent types. No
need for type guards or conversions.
Use both timestamp formats -
timestamp for calculations, timestampISO
for display and logging.Monitoring normalization
Track normalization metrics in the Uniblock dashboard:- Normalization success rate - Percentage of responses successfully normalized
- Field mapping coverage - Which provider fields are being mapped
- Type conversion errors - Rare cases where normalization fails
- Provider format changes - Alerts when providers change response formats
- Ensure consistent data quality
- Identify provider format changes early
- Understand which providers require most normalization
- Validate data integrity across providers
Next steps
Data polyfill
Learn how Uniblock fills data gaps across providers.
Data consensus
Verify data accuracy by comparing multiple providers.
API reference
Explore normalized response schemas for all endpoints.
Dashboard
Monitor normalization metrics and data quality.