{"id":20735746,"url":"https://github.com/iamfaizankhalid/jsonq","last_synced_at":"2026-04-24T19:31:43.410Z","repository":{"id":186300452,"uuid":"674625768","full_name":"IamFaizanKhalid/jsonq","owner":"IamFaizanKhalid","description":"Easily traverse through the JSON data with no fixed structure.","archived":false,"fork":false,"pushed_at":"2023-08-13T07:50:06.000Z","size":9,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-11T11:14:12.503Z","etag":null,"topics":["go","json","jsonquery","traversal"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/IamFaizanKhalid.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-04T11:58:38.000Z","updated_at":"2023-08-13T07:45:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"e574b894-01f9-4e67-b590-d6d99cce6729","html_url":"https://github.com/IamFaizanKhalid/jsonq","commit_stats":null,"previous_names":["iamfaizankhalid/jsonq"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/IamFaizanKhalid/jsonq","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Fjsonq","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Fjsonq/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Fjsonq/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Fjsonq/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/IamFaizanKhalid","download_url":"https://codeload.github.com/IamFaizanKhalid/jsonq/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/IamFaizanKhalid%2Fjsonq/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32238290,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-24T13:21:15.438Z","status":"ssl_error","status_checked_at":"2026-04-24T13:21:15.005Z","response_time":64,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","json","jsonquery","traversal"],"created_at":"2024-11-17T05:39:27.137Z","updated_at":"2026-04-24T19:31:43.394Z","avatar_url":"https://github.com/IamFaizanKhalid.png","language":"Go","readme":"# jsonq\n\n\u003cimg align=\"right\" width=\"150\" src=\"https://user-images.githubusercontent.com/209884/92572337-42b42900-f2bf-11ea-973a-c74a359553a5.png\" alt=\"jsonq\"\u003e\n\n[![Go Report Card](https://goreportcard.com/badge/github.com/IamFaizanKhalid/jsonq)](https://goreportcard.com/report/github.com/IamFaizanKhalid/jsonq) [![Release](https://img.shields.io/github/v/release/IamFaizanKhalid/jsonq.svg?style=flat-square)](https://github.com/IamFaizanKhalid/jsonq/releases) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE) [![GoDoc](https://pkg.go.dev/badge/github.com/IamFaizanKhalid/jsonq)](https://pkg.go.dev/github.com/IamFaizanKhalid/jsonq)\n\n\nEasily traverse through the JSON data with no fixed structure.\n\n## Installation\n\n```shell\ngo get -u github.com/IamFaizanKhalid/jsonq\n```\n\n## Usage Example\n\nSee [reference docs](https://pkg.go.dev/github.com/IamFaizanKhalid/jsonq) for more details.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\n\t\"github.com/IamFaizanKhalid/jsonq\"\n)\n\nfunc main() {\n\tapiResponse := []byte(`{\n\t\t\"code\": 200,\n\t\t\"status\": \"success\",\n\t\t\"data\": {\n\t\t\t\"user\": {\n\t\t\t\t\"id\": 123,\n\t\t\t\t\"name\": \"John Doe\",\n\t\t\t\t\"email\": \"john@example.com\"\n\t\t\t},\n\t\t\t\"posts\": [\n\t\t\t\t{\n\t\t\t\t\t\"id\": 1,\n\t\t\t\t\t\"title\": \"First Post\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"id\": 2,\n\t\t\t\t\t\"title\": \"Second Post\"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t}`)\n\n\t// parsing the JSON object\n\tresp, err := jsonq.ParseObject(apiResponse)\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// getting values from the object\n\tcode := resp.Val(\"code\").Int()\n\tstatus := resp.Val(\"status\").Str()\n\n\tfmt.Println(code, status)\n\n\t// checking if the object contains the sub-object\n\tif !resp.Has(\"data\") {\n\t\treturn\n\t}\n\tdata := resp.Obj(\"data\")\n\n\t// getting a sub-object which is optional\n\tuserInfo, ok := data.OptObj(\"user\")\n\tif ok {\n\t\tfmt.Println(\"-- User Info --\")\n\n\t\tfmt.Println(\"ID:\", userInfo.Val(\"id\").Int())\n\t\tfmt.Println(\"Name:\", userInfo.Val(\"name\").Str())\n\t\tfmt.Println(\"Email:\", userInfo.Val(\"email\").Str())\n\t}\n\n\tfmt.Println(\"-- Posts --\")\n\n\t// getting array of objects\n\tposts := data.Arr(\"posts\").Obj()\n\n\tfor _, post := range posts {\n\t\tid := post.Val(\"id\").Int()\n\t\ttitle := post.Val(\"title\").Str()\n\n\t\tfmt.Println(id, title)\n\t}\n}\n```\n\n\n## License\n\n[MIT License](./LICENSE)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfaizankhalid%2Fjsonq","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fiamfaizankhalid%2Fjsonq","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fiamfaizankhalid%2Fjsonq/lists"}