Skip to main content

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:
  1. Provider response - Raw data received from blockchain provider
  2. Schema mapping - Uniblock maps provider fields to unified schema
  3. Type conversion - Converts data types (string/number/formatted)
  4. Field enrichment - Adds missing fields with computed values
  5. Unified response - Returns consistent format to your application
Result: Your code works with any provider without format-specific logic.

Normalization examples

Token balances

Different providers return token balances in incompatible formats: Uniblock normalized response:
Result: All three formats unified into single, predictable structure.

Transaction timestamps

Providers use different timestamp formats: Uniblock normalized response:
Result: Both Unix and ISO formats provided for flexibility.

NFT metadata

NFT metadata structures vary significantly across providers: Alchemy format:
Moralis format:
Uniblock normalized response:
Result: Consistent structure with both IPFS and HTTP URLs, parsed attributes, and camelCase fields.

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:
With Uniblock normalization:
Result: 90% less code, zero provider-specific logic.

Scenario 3: NFT marketplace integration

Challenge: Displaying NFT collections from multiple providers with consistent metadata. Request:
Normalized response:
Result: Consistent NFT structure with resolved IPFS URLs and parsed attributes.

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:

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
Uniblock normalization:
Result: Consistent null handling and default values.

IPFS URLs

Provider behavior:
  • Some return ipfs:// URIs
  • Others return gateway URLs
  • Some return raw CIDs
Uniblock normalization:
Result: Both IPFS URI and HTTP gateway URL provided.

Large numbers

Provider behavior:
  • Some return numbers (lose precision for large values)
  • Others return strings
  • Some return scientific notation
Uniblock normalization:
Result: String format preserves precision, formatted version for display.

Case sensitivity

Provider behavior:
  • Some use camelCase
  • Others use snake_case
  • Some use PascalCase
Uniblock normalization:
Result: Consistent camelCase across all fields.

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
Use these metrics to:
  • 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.

Common pitfalls

Don’t re-parse normalized data - Normalized responses are already in optimal format. Additional parsing adds complexity and potential errors.
Avoid provider-specific assumptions - Don’t assume data comes from specific provider. Normalization abstracts provider details.
Use string types for large numbers - JavaScript numbers lose precision for values > 2^53. Always use string balance field, not numeric conversions.
Don’t mix normalized and raw data - If using Uniblock, use normalized responses exclusively. Mixing with raw provider data creates inconsistencies.