API formatter

    Parse and pretty-print JSON payloads. Invalid documents show an error below.

    Related Guides & Tutorials

    // developers also read

    Terminal Equivalent

    Produce ISO and RFC 3339 strings from the shell for headers, JWT claims, and JSON APIs.

    bash
    # Format timestamp for API response using curl + jq
    curl -s api.example.com/data | \
      jq '.timestamp | strftime("%Y-%m-%dT%H:%M:%SZ")'
    
    # Generate ISO 8601 timestamp for API call
    date -u +"%Y-%m-%dT%H:%M:%SZ"
    
    # RFC 3339 format (used by Google APIs)
    date -u +"%Y-%m-%dT%H:%M:%S+00:00"
    
    # Unix ms timestamp for JavaScript APIs
    date +%s%3N

    Language Quick Reference

    python
    # Python — format for REST API
    from datetime import datetime, timezone
    ts = 1733569200
    iso = datetime.fromtimestamp(ts, tz=timezone.utc).isoformat()
    print(iso)  # 2024-12-07T04:00:00+00:00

    How It Works

    REST APIs commonly use ISO 8601 (2024-12-07T04:00:00Z) because it's human-readable, sortable as a string, and unambiguous. GraphQL typically uses Unix timestamps as integers for efficiency. AWS uses ISO 8601 with milliseconds. Stripe uses Unix seconds. Always check the API docs — sending milliseconds to an endpoint expecting seconds will produce dates 1000x in the future.