JSON to Go Struct
Paste JSON to generate a Go struct with json tags. Nested objects become inline structs and arrays become slices.
Paste JSON to generate a Go struct with json tags. Nested objects become inline structs and arrays become slices.
Paste JSON and get a ready-to-use Go struct back. Each key becomes an exported field with a json tag carrying the original name, so encoding/json round-trips your data without extra config. Nested objects turn into inline structs and arrays turn into slices of the right element type.
Hand-writing structs to unmarshal an API response is slow and easy to get wrong, especially with deeply nested payloads. Drop the JSON here and get the struct in seconds. It saves you from counting brackets and guessing whether a number should be an int or a float64.
Keys like user_id or api-url become UserID and APIURL, following Go's convention of capitalizing common initialisms (ID, URL, API, HTTP, and so on). Whole numbers map to int, decimals to float64, true/false to bool, and strings to string. When a field shows different shapes across array elements, the output falls back to interface{} so it still compiles.