{"id":18779340,"url":"https://github.com/zostay/go-esv-api","last_synced_at":"2025-12-17T23:30:17.313Z","repository":{"id":66558007,"uuid":"312452563","full_name":"zostay/go-esv-api","owner":"zostay","description":"ESV API SDK for Go","archived":false,"fork":false,"pushed_at":"2024-01-22T23:25:33.000Z","size":59,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-12-29T10:28:54.100Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/zostay.png","metadata":{"files":{"readme":"README.md","changelog":"Changes.md","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":"2020-11-13T02:31:53.000Z","updated_at":"2024-01-22T21:41:51.000Z","dependencies_parsed_at":"2024-11-12T07:34:49.781Z","dependency_job_id":null,"html_url":"https://github.com/zostay/go-esv-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zostay%2Fgo-esv-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zostay%2Fgo-esv-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zostay%2Fgo-esv-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zostay%2Fgo-esv-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zostay","download_url":"https://codeload.github.com/zostay/go-esv-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239690529,"owners_count":19681119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-11-07T20:19:40.848Z","updated_at":"2025-12-17T23:30:17.260Z","avatar_url":"https://github.com/zostay.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ESV API for Go\n\nThis is a small SDK for allowing Go programs to easily contact the ESV Bible API\nat \u003chttps://api.esv.org/\u003e.\n\n# Installation\n\nBefore using this library, you will need to get an ESV API key from the [ESV \nAPI](https://api.esv.org/).\n\nThis provides no front-end for the end user. If you are interested in a \nfront-end, see the [today](https://github.com/zostay/today) project.\n\nTo use this package in your project, import it in the usual Go way:\n\n```shell\ngo get github.com/zostay/go-esv-api\n```\n\n# Examples\n\nWhile this does not provide an installed binary, there are some example in the `example/` directory:\n\n```shell\ngo run ./examplex/text\ngo run ./example/html\ngo run ./example/search\n```\n\n# Usage\n\nTo use the API, you will need to construct a client, and then make API calls \nvia the returned SDK client.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    \"github.com/zostay/go-esv-api/pkg/esv\"\n)\n\nfunc main() {\n    client := esv.New(os.Getenv(\"ESV_API_KEY\"))\n\n    passage, err := client.PassageText(\"John 3:16\")\n    if err != nil {\n        panic(err)\n    }\n\n    fmt.Println(passage.Passages[0])\n}\n```\n\n# SDK Guide\n\n## Options\n\nThe optional parameters for the API calls are provided using a variadic list \nof options at the end of the API calls. All the option functions begin with \n`With` in the option constructor name.\n\nThis SDK shares options across endpoints, so you'll need to see the \n[documentation for the ESV API](https://api.esv.org/) to know which options \napply to each API endpoint.\n\n## Passage Text\n\nThe `PassageText` method will return plain text for the queried passage or \npassages.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\n\t\"github.com/zostay/go-esv-api/pkg/esv\"\n)\n\nfunc main() {\n\tclient := esv.New(os.Getenv(\"ESV_API_KEY\"))\n\n\tpassage, err := client.PassageText(\"John 3:16\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\tfmt.Println(passage.Passages[0])\n}\n```\n\n## Passage HTML\n\nThe `PassageHtml` method will return HTML for the queried passage or passages.\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"runtime\"\n\n\t\"github.com/zostay/go-esv-api/pkg/esv\"\n)\n\nfunc main() {\n\tclient := esv.New(os.Getenv(\"ESV_API_KEY\"))\n\n\tpassage, err := client.PassageHtml(\"John 3:16\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\t\n    hf, err := os.Create(\"john316.html\")\n    if err != nil {\n        panic(err)\n    }\n    defer hf.Close()\n\n\tfmt.Fprint(hf, passage.Passages[0])\n\t\n\topenCmd := \"\"\n\tswitch runtime.GOOS {\n    case \"darwin\":\n        openCmd = \"open\"\n    case \"linux\":\n        openCmd = \"xdg-open\"\n\tcase \"windows\":\n        openCmd = \"start\"\n    default:\n        panic(\"unsupported platform\")\n    }\n\t\n\terr = exec.Command(openCmd, \"john316.html\").Run()\n\tif err != nil {\n        panic(err)\n    }\n}\n```\n\n## Passage Search\n\nThe `PassageSearch` method will return a list of passages that match the\nprovided query.\n\n```go\npackage main\n\nimport (\n    \"fmt\"\n    \"os\"\n\n    \"github.com/zostay/go-esv-api/pkg/esv\"\n)\n\nfunc main() {\n    client := esv.New(os.Getenv(\"ESV_API_KEY\"))\n\n    passages, err := client.PassageSearch(\"resurrection\")\n    if err != nil {\n        panic(err)\n    }\n\n    for _, passage := range passages.Results {\n        fmt.Printf(\"%s: %s\\n\", passage.Reference, passage.Content)\n    }\n}\n```\n\n## Passage Audio\n\nThis is not yet implemented. See below.\n\n# Implemented vs. To Do\n\nThe passage text, passage HTML, and search endpoints are implemented.\n\nThe audio endpoint is not working. However, that it should be very simple to\nprovide the audio link given by the redirect. I just haven't written the code\nfor that into the generator template.\n\n# Copyright \u0026 License\n\nCopyright 2020 Andrew Sterling Hanenkamp\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\nCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\nIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\nCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzostay%2Fgo-esv-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzostay%2Fgo-esv-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzostay%2Fgo-esv-api/lists"}