{"id":40578074,"url":"https://github.com/goavega-software/restful","last_synced_at":"2026-01-21T02:30:47.190Z","repository":{"id":61626804,"uuid":"544761274","full_name":"goavega-software/restful","owner":"goavega-software","description":"Restful is a simple REST API caller written in golang","archived":false,"fork":false,"pushed_at":"2023-12-04T12:00:38.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-06-20T12:01:47.821Z","etag":null,"topics":["go","golang","rest","rest-api","restful-api"],"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/goavega-software.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":"2022-10-03T07:14:04.000Z","updated_at":"2024-02-05T12:05:33.000Z","dependencies_parsed_at":"2023-12-04T12:44:09.092Z","dependency_job_id":null,"html_url":"https://github.com/goavega-software/restful","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/goavega-software/restful","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goavega-software%2Frestful","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goavega-software%2Frestful/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goavega-software%2Frestful/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goavega-software%2Frestful/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goavega-software","download_url":"https://codeload.github.com/goavega-software/restful/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goavega-software%2Frestful/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28623212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T23:49:58.628Z","status":"online","status_checked_at":"2026-01-21T02:00:08.227Z","response_time":86,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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","golang","rest","rest-api","restful-api"],"created_at":"2026-01-21T02:30:45.694Z","updated_at":"2026-01-21T02:30:47.185Z","avatar_url":"https://github.com/goavega-software.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# REST API Manager \n\nAllows you to call any API and then transform the returned json data and return back. Restful also supports using JSONPath style xpath to filter the JSON data. Currently, if both XPath and Transformer are provided, restful pipes the output of XPath to Transformer and then returns the final result. \n\nExample use\n\n```golang\nfunc main() {\n\t// Get a message and print it.\n\toptions := Options{}\n\toptions.Method = \"GET\"\n\toptions.Headers = make(map[string]string)\n\toptions.Headers[\"Content-Type\"] = \"application/json\"\n\toptions.XPath = \"$.results[0].name\"\n\toptions.Transformer = `\n\t[\n\t\t{\n\t\t\t\"operation\": \"delete\",\n\t\t\t\"spec\": {\n\t\t\t  \"paths\": [\"title\"]\n\t\t\t}\n\t\t  }\n\t  ]\t\n\t`\n\tmessage, _ := Call(\"https://randomuser.me/api/\", \u0026options)\n\tfmt.Print(message)\n}\n```\n\nThe above ex. makes the API call, extracts the name object from JSON, removes the `title` and returns back.\n\nJSON Transformation supports Jolt like transformations using [Kazaam](https://github.com/qntfy/kazaam)\nXPath provides complete implementation of http://goessner.net/articles/JsonPath/ using [JsonPath](https://github.com/PaesslerAG/jsonpath)\nSupports Basic authorization, and token/key based authentication.\n\nThere is basic string interpolation support in url, raw body and headers. Tokens in the form of `${var}` are replaced with `os.Getenv(var)`. Below is one example:\n\n```golang\nfunc main() {\n\toptions := restful.Options{}\n\toptions.Method = \"GET\"\n\toptions.Headers = make(map[string]string)\n\toptions.Headers[\"Content-Type\"] = \"application/json\"\n\toptions.Transformer = `[\n\t\t{\n\t\t\t\"operation\": \"shift\", \n\t\t\t  \"spec\": {\n\t\t\t\t\"data.title\": \"joke\",\n\t\t\t\t\"data.subtitle\": \"category\"\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\"operation\": \"default\",\n\t\t\"spec\": {\n\t\t  \"event\": \"jotd\"\n\t\t}\n\t  }\n\t  ]`\n\tos.Setenv(\"type\", \"single\")\n\tmessage, _ := restful.Call(\"https://v2.jokeapi.dev/joke/Programming?blacklistFlags=nsfw,religious,political,racist,sexist,explicit\u0026type=${type}\", \u0026options)\n\tfmt.Println(message)\n}\n\n```\n## Embedded JavaScript Engine\nStarting from version 0.4, Restful introduces an integrated ES2015/ES6 JavaScript runtime for scenarios where basic XPath and Transforms fall short. The options.JS parameter accepts a JavaScript literal that enables the transformation of input data. The JSON obtained from the API call is accessible through the *data* variable within the JavaScript code block. The JavaScript string should conclude with the value to be exported, as illustrated in the example below with the result being the exported output.\n\n```golang\n\toptions := Options{}\n\toptions.Method = \"GET\"\n\toptions.Headers = make(map[string]string)\n\toptions.Headers[\"Content-Type\"] = \"application/json\"\n\toptions.JS = `const x = data.results.map(u =\u003e u.name)[0];\n\tconst { first, last } = x;` +\n\t\t\"const result = {\\\"name\\\": `${last}, ${first}`};result;\"\n\tmessage, _ := Call(\"https://randomuser.me/api/\", \u0026options)\n\tfmt.Print(message)\n\tt.Log(message)\n```\n\nSequencing of transforms (output of each transform is fed into the next step as input):\n1. JS \n2. XPath\n3. Transformer","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoavega-software%2Frestful","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoavega-software%2Frestful","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoavega-software%2Frestful/lists"}