{"id":34123125,"url":"https://github.com/5sigma/spyder","last_synced_at":"2026-06-01T10:31:53.095Z","repository":{"id":57523060,"uuid":"99621215","full_name":"5Sigma/spyder","owner":"5Sigma","description":"API Testing and Request Framework","archived":false,"fork":false,"pushed_at":"2018-07-18T14:14:15.000Z","size":564,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-06-21T01:48:58.635Z","etag":null,"topics":["api","go","golang","http","testing"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/5Sigma.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}},"created_at":"2017-08-07T21:16:33.000Z","updated_at":"2018-01-30T13:28:24.000Z","dependencies_parsed_at":"2022-08-28T11:20:39.463Z","dependency_job_id":null,"html_url":"https://github.com/5Sigma/spyder","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/5Sigma/spyder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5Sigma%2Fspyder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5Sigma%2Fspyder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5Sigma%2Fspyder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5Sigma%2Fspyder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/5Sigma","download_url":"https://codeload.github.com/5Sigma/spyder/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/5Sigma%2Fspyder/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27737690,"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","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"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":["api","go","golang","http","testing"],"created_at":"2025-12-14T22:04:13.502Z","updated_at":"2025-12-14T22:04:16.270Z","avatar_url":"https://github.com/5Sigma.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build\nStatus](https://travis-ci.org/5Sigma/spyder.svg?branch=master)](https://travis-ci.org/5Sigma/spyder)\n\n# Spyder\nAPI Testing and Request Framework\n\n- Easily make requests to predefined API endpoints and explor their responses, headers, and other data\n- Making a request drops to a request \"explorer\" session to easily look at various parts of the request in the terminal.\n- Collaborate with a team without the need for any kind of syncing service. Simply use GIT to version the project.\n- Local configurations to override the versioned configurations. Allowing multiple developers to work easily with slightly different local setups.\n- Stress test endpoints with fast repeated requests and aggregate timing statistics.\n- Dynamically alter requests using a Javascript based scripting language.\n- Variable management using the scripting language or configuration files\n- Generate specific types of random data such as names, phone numbers, products names, address parts, etc\n- Automate tasks using the configured API endpoints with scripts\n\n## Installation\n\n### OSX\n\nOn OSX, spyder can be install with brew:\n\n```\nbrew install 5sigma/tap/spyder\n```\n\n### Linux \n\nDownload the linux package from for the latest release:\n\nhttps://github.com/5Sigma/spyder/releases/latest\n\n#### Debain file\n\n```\nsudo dpkg -i spyder_xx.xx.xx_linux_amd64.deb\n```\n\n#### RPM File\n\n```\nsudo rpm –ivh spyder_xx.xx.xx_linux_amd64.rpm\n```\n\n#### Snapcraft\n\n```\nsudo snap install spyder_xx.xx.xx_linux_amd64.rpm\n```\n\n### Windows\n\nWindows binaries can be found in the release:\n\nhttps://github.com/5Sigma/spyder/releases/latest\n\n## API Testing and Requests\n\nSpyder provides an easy interface to make and test API endpoints from within the terminal.\nIt uses simple JSON configuration files which are meant to be versioned. It also has built in\nscripting support for dynamically modifying endpoint configuration and performing certain\ntypes of tasks, such as appending authentication, persisting tokens, etc.\n\n\n## Start a project\n\nSpyder expects the configuration for a set of endpoints to live in its own folder structure.\nThis folder can then be versioned to allow for easy maintain and team synchronization. \nThe `init` command will generate the folder structure for you. Just run it in an empty folder.\n\n```\nspyder init\n```\n\n## Configuring an endpoint\n\nEndpoints are defined in JSON files inside the endpoints folder. For example to\ncreate an product list endpoint we might place a file at \n`project_root/endpoints/products/list.json`. A simple endpoint looks like this:\n\n```js\n  {\n    \"url\": \"http://example.com/api/products\"\n    \"method\": \"GET\"\n  }\n```\n\n## Handling parameters\n\nRequest parameters can be passed using the \"data\" node in the configuration.\nFor GET requests these are encoded and added to the url when the request is\nmade.\n\nFor POST requests the node is submitted as a JS object in the post body.\n\n### Example: A simple GET request\n\n```js\n  {\n    \"url\": \"http://example.com/api/products\"\n    \"method\": \"GET\",\n    \"data\": {\n      \"pageSize\": 10,\n      \"page\": 1\n    }\n  }\n```\n\n\n### Example: A simple POST request\n\n```js\n  {\n    \"url\": \"http://example.com/api/products\"\n    \"method\": \"POST\",\n    \"data\": {\n      \"data\": {\n        \"attributes\": {\n           \"name\": \"My Product\",\n           \"price\": 399.99\n        }\n      }\n    }\n  }\n```\n\nFor more information about endpoints check out the [Endpoint Configuration Reference](https://github.com/5Sigma/spyder/wiki/Endpoint-Configuration-Reference)\n\nThe easiest way of handling dynamic data is by using variables directly inside\nthe configuration. There are two configuration files: \n\n- config.json - This holds the base configuration for the project and can store\n    variables that may change over time.\n- config.local.json - This file is meant for the specific user and should not be\n    checked in to versioning.  It allows overriding the default global variables\n    as well as adding ones specific to the person. Such as test account\n    credentials, tokens,etc.\n\nIf your config.local.json looked something like this:\n\n```js\n  {\n    \"variables\": {\n      \"token\": \"ababab123121\"\n    }\n  }\n```\n\nYou could then make a endpoint configuration that uses it. Variables are\nspecified with a preceding `$` and are expanded into their values before the\nrequest is made.\n\n```js\n  {\n    \"url\": \"http://exmaple.com/api/auth\",\n    \"method\": \"POST\",\n    \"headers\": {\n      \"Content-Type\": \"application/json\"\n    },\n    \"data\": {\n      \"token\": \"$token\"\n    }\n  }\n```\n\n## Advanced requests using scripting\n\nSpyder has a built in JavaScript interpreter. It supports two types of hooks.\n\n- **On Complete** - When the request is made and a response is received on\n    complete scripts can be fired. These are useful for setting variables to the\n    result of a request.\n\n- **Transform** - Transform scripts are given the request before it is sent and\n    given the option to transform it in some way. This allows more dynamic\n    control over the request. Things like injecting authorization tokens,\n    or conditional data.\n\n\n### Example: Handling an endpoint that requires an HAMC signature \n\nConsider having a set of endpoints where you must first authenticate to an auth\nendpoint and receive a session token. Then use this token to sign future\nrequests using HMAC.\n\nThe authorization endpoint might look like this:\n\n```js\n\n{\n  \"url\": \"http://example.com/auth\",\n  \"method\": \"POST\",\n  \"headers\": {\n    \"Content-Type\": \"application/json\"\n  },\n  \"onComplete\": [\"storeAuthSession\"],\n  \"data\": {\n    \"token_id\": \"aaabab12312\",\n    \"token_secret\": \"aaabab12312\",\n  }\n}\n```\n\nThis utilizes an onComplete script to save out the token. A\n`scripts/storeAuthSession.js` file might look like:\n\n```js\n$variables.set('session_token_id', $response.body.data.session.session_id);\n$variables.set('session_token_secret', $response.body.data.session.session_secret);\n```\n\nA standard request to the API then might look like: \n\n```js\n  {\n    \"url\": \"http://exmaple.com/api/products\",\n    \"method\": \"get\",\n    \"trasnform\": [\"signRequest\"]\n  }\n```\n\nThis request uses a transform script located at `scripts/signRequest.js`. That\ncould look like:\n\n```js\nsignature = $hmac($variables.get('session_token_secret'), a JS objectrequest.body);\n$request.headers.set('Authorization', $variables.get('session_token_id') + ':' + signature)\n```\n\nFor more information on scripting see the [Scripting Reference](https://github.com/5Sigma/spyder/wiki/Script-Reference)\n\n\n# Stress testing\n\nEndpoints can be rapidly requested for stress testing using the `hammer`\ncommand.  The request will be made a number of times specified by the count\nflag, or 100 times by default. \n\n```\nspyder hammer --count 1000 myEndpoint\n```\n\nFor more information on scripting see the [Scripting Reference](https://github.com/5Sigma/spyder/wiki/Script-Reference)\n\n\n# Tasks\n\nThe tasks folder can contain scripts intended to automate a series of requests to an API. Using the `$endpoint` function exposed to scripts requests can be made to configured endpoints. The request parameters can also be altered during the task.\n\n```javascript\n\nuserResponse = $endpoint('users/me');\nuserId = userResponse.body.id;\nproductResponse = $endpoint('products/create', { name: 'myProduct', userId: userId });\n$endpoint('products/archive', { id: productResponse.body.id });\nconsole.log('Created new archived product for ' + userRepsonse.body.name);\n```\n\nTo run a task use the `task` command in spider. For example, to run a task at `tasks/products/archive.js`:\n\n```\nspyder task products/archive\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5sigma%2Fspyder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F5sigma%2Fspyder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F5sigma%2Fspyder/lists"}