{"id":28384731,"url":"https://github.com/stackexchange/so4t_data_export","last_synced_at":"2025-06-26T00:32:59.288Z","repository":{"id":244282081,"uuid":"814790432","full_name":"StackExchange/so4t_data_export","owner":"StackExchange","description":null,"archived":false,"fork":false,"pushed_at":"2025-06-12T13:12:07.000Z","size":21,"stargazers_count":0,"open_issues_count":0,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-06-12T14:27:42.263Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/StackExchange.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,"zenodo":null}},"created_at":"2024-06-13T17:57:10.000Z","updated_at":"2025-06-12T13:12:11.000Z","dependencies_parsed_at":"2025-06-12T14:23:10.655Z","dependency_job_id":null,"html_url":"https://github.com/StackExchange/so4t_data_export","commit_stats":null,"previous_names":["stackexchange/so4t_data_export"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/StackExchange/so4t_data_export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2Fso4t_data_export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2Fso4t_data_export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2Fso4t_data_export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2Fso4t_data_export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/StackExchange","download_url":"https://codeload.github.com/StackExchange/so4t_data_export/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/StackExchange%2Fso4t_data_export/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261977503,"owners_count":23239367,"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":"2025-05-30T09:30:33.085Z","updated_at":"2025-06-26T00:32:59.279Z","avatar_url":"https://github.com/StackExchange.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Stack Overflow for Teams Data Export (so4t_data_export)\nAn API script for Stack Overflow for Teams that creates a JSON export of users, user groups, tags, articles, questions, answers, and comments. It uses a combination of both versions of the API (i.e., 2.3 and 3) in order to create the most comprehensive export possible.\n\n\n## Requirements\n* A Stack Overflow for Teams instance (Basic, Business, or Enterprise)\n* Python 3.x ([download](https://www.python.org/downloads/))\n* Operating system: Linux, MacOS, or Windows\n\n## Setup\n[Download](https://github.com/StackExchange/so4t_data_export/archive/refs/heads/main.zip) and unpack the contents of this repository\n\n**Installing Dependencies**\n\n* Open a terminal window (or, for Windows, a command prompt)\n* Navigate to the directory where you unpacked the files\n* Install the dependencies: `pip3 install -r requirements.txt`\n\n**API Authentication**\n\nYou'll need an API token for the basic and business tiers. You'll need to obtain an API key and an API token for Enterprise.\n\n* For Basic or Business, instructions for creating a personal access token (PAT) can be found in [this KB article](https://stackoverflow.help/en/articles/4385859-stack-overflow-for-teams-api).\n* For Enterprise, documentation for creating the key and token can be found within your instance at this url: `https://[your_site]/api/docs/authentication`\n\nCreating an access token for Enterprise can sometimes be tricky for people who haven't done it before. Here are some (hopefully) straightforward instructions:\n* Go to the page where you created your API key. Take note of the \"Client ID\" associated with your API key.\n* Go to the following URL, replacing the base URL, the `client_id`, and the base URL of the `redirect_uri` with your own:\n`https://YOUR.SO-ENTERPRISE.URL/oauth/dialog?client_id=111\u0026redirect_uri=https://YOUR.SO-ENTERPRISE.URL/oauth/login_success`\n* You may be prompted to log in to Stack Overflow Enterprise if you're not already. Either way, you'll be redirected to a page that simply says \"Authorizing Application.\"\n* In the URL of that page, you'll find your access token. Example: `https://YOUR.SO-ENTERPRISE.URL/oauth/login_success#access_token=YOUR_TOKEN`\n\n## Usage\nIn a terminal window, navigate to the directory where you unpacked the script. \nRun the script using the following format, replacing the URL, token, and/or key with your own:\n* For Basic and Business: `python3 so4t_data_export.py --url \"https://stackoverflowteams.com/c/TEAM-NAME\" --token \"YOUR_TOKEN\"`\n* For Enterprise: `python3 so4t_data_export.py --url \"https://SUBDOMAIN.stackenterprise.co\" --key \"YOUR_KEY\" --token \"YOUR_TOKEN\"`\n\nThe script can take several minutes to run, particularly as it gathers data via the API. As it runs, it will update the terminal window with the tasks it performs.\n\nWhen the script completes, it will indicate the JSON files will be created in the same directory where the script is located. The files will be named articles.json, questions_answers_comments.json, tags.json, user_groups.json, and users.json.\n\n## Known Limitations\n* Images are not exported\n* Collections and Communities do not have an API endpoint, so they are not exported\n\n## Support, security, and legal\nIf you encounter problems using the script, please leave feedback in the Github Issues. You can also clone and change the script to suit your needs. It is provided as-is, with no warranty or guarantee of any kind.\n\nAll data obtained via the API is handled locally on the device from which the script is run. The script does not transmit data to other parties like Stack Overflow. All API calls performed are read-only, so there is no risk of editing or adding content to your Stack Overflow for Teams instance.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackexchange%2Fso4t_data_export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackexchange%2Fso4t_data_export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackexchange%2Fso4t_data_export/lists"}