whatisgithub

What is jsonparser?

buger/jsonparser — explained in plain English

Analysis updated 2026-06-26

5,612GoAudience · developerComplexity · 2/5Setup · easy

In one sentence

jsonparser is a Go library for reading specific fields from JSON data up to 10x faster than Go's built-in JSON package, without needing to define data structures for the whole document upfront.

Mindmap

mindmap
  root((repo))
    What it does
      Read JSON fields
      No struct needed
      Single scan reads
    Performance
      10x faster
      Zero allocation
      Low GC pressure
    API
      Get by path
      ArrayEach
      ObjectEach
      EachKey batch
    Use cases
      API response parsing
      High throughput
      Dynamic JSON
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Extract specific fields from third-party API responses without defining a full Go struct for every response shape.

USE CASE 2

Process large volumes of JSON messages with minimal memory allocation and reduced garbage collection pressure.

USE CASE 3

Read multiple fields from one JSON payload in a single scan using EachKey, instead of calling Get multiple times.

USE CASE 4

Iterate over all elements in a JSON array or all key-value pairs in an object with a single function call.

What is it built with?

Go

How does it compare?

buger/jsonparsercri-o/cri-orussross/blackfriday
Stars5,6125,6115,617
LanguageGoGoGo
Setup difficultyeasyhardeasy
Complexity2/54/52/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · easy Time to first run · 5min

So what is it?

jsonparser is a Go library for reading JSON data quickly, without needing to define the shape of the data in advance. Go's built-in JSON package requires you to write out a struct that matches the structure of the JSON you plan to receive. If the data comes from a third-party API and its structure is unpredictable or changes over time, that approach gets awkward. jsonparser lets you pull out individual fields by specifying a path, more like looking something up in a nested dictionary than mapping the whole thing to a type. The library's main selling point is speed. According to the benchmarks in the README, it can be up to ten times faster than Go's standard encoding/json package, and it avoids memory allocation during parsing. That makes it useful in high-throughput situations where you are processing a large number of JSON responses and do not want garbage collection pressure from repeated allocations. The API centers on a Get function that takes the raw JSON bytes and a sequence of keys that form a path into the document. For example, to read a nested field you pass the outer key first, then the inner key, and the function returns the value as a byte slice along with its type. There are helper functions for common types: GetString, GetInt, GetFloat, and GetBoolean. Arrays can be iterated with ArrayEach, which calls a function for each element. ObjectEach does the same for key-value pairs in an object. For cases where you need to read several different fields from the same document, an EachKey function scans the payload only once and calls your callback each time it finds one of the paths you listed. This is more efficient than calling Get multiple times, since each Get call reads through the data independently. The library also includes a Set function for writing or updating values in existing JSON bytes. The README includes extensive code examples and benchmark comparisons against other Go JSON libraries.

Copy-paste prompts

Prompt 1
Using buger/jsonparser in Go, write code to extract the nested fields user.name and user.email from an API response without defining a struct.
Prompt 2
Show me how to use jsonparser's ArrayEach to iterate over a JSON array of objects and print each item's id field.
Prompt 3
Write a Go function using jsonparser's EachKey to read 5 different fields from a large JSON payload in one single scan for maximum performance.
Prompt 4
How does jsonparser's Get function work compared to Go's encoding/json Unmarshal, show me both approaches side by side for parsing the same response.

Frequently asked questions

What is jsonparser?

jsonparser is a Go library for reading specific fields from JSON data up to 10x faster than Go's built-in JSON package, without needing to define data structures for the whole document upfront.

What language is jsonparser written in?

Mainly Go. The stack also includes Go.

How hard is jsonparser to set up?

Setup difficulty is rated easy, with roughly 5min to a first successful run.

Who is jsonparser for?

Mainly developer.

Open on GitHub → Ask about another repo

This repo across BitVibe Labs

Verify against the repo before relying on details.