{"id":16542551,"url":"https://github.com/jordaneremieff/headless-api","last_synced_at":"2025-09-30T02:31:50.971Z","repository":{"id":89251384,"uuid":"280857342","full_name":"jordaneremieff/headless-api","owner":"jordaneremieff","description":"Python API service for headless Chromium","archived":false,"fork":false,"pushed_at":"2020-07-19T15:46:20.000Z","size":259,"stargazers_count":19,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-17T15:51:30.004Z","etag":null,"topics":["aws-lambda","fastapi","headless-chrome","mangum","python","selenium","serverless","starlette"],"latest_commit_sha":null,"homepage":"","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/jordaneremieff.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":"2020-07-19T12:06:34.000Z","updated_at":"2024-04-09T06:10:45.000Z","dependencies_parsed_at":"2023-07-25T18:31:31.305Z","dependency_job_id":null,"html_url":"https://github.com/jordaneremieff/headless-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fheadless-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fheadless-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fheadless-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jordaneremieff%2Fheadless-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jordaneremieff","download_url":"https://codeload.github.com/jordaneremieff/headless-api/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":234692583,"owners_count":18872471,"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":["aws-lambda","fastapi","headless-chrome","mangum","python","selenium","serverless","starlette"],"created_at":"2024-10-11T18:57:54.643Z","updated_at":"2025-09-30T02:31:45.639Z","avatar_url":"https://github.com/jordaneremieff.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Headless API\n\nPython API service for headless Chromium.\n\nThis project consists of a [FastAPI](https://fastapi.tiangolo.com/) application for running [headless Chromium](https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md) browser commands using [Selenium](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver), and includes an example [Serverless](https://www.serverless.com/) configuration for AWS Lambda \u0026 API Gateway deployments that requires [Serverless-Chrome](https://github.com/adieuadieu/serverless-chrome) and [ChromeDriver](https://chromedriver.chromium.org/) binaries for headless Chromium support and [Mangum](https://mangum.io/) to wrap the ASGI application.\n\nIt is also possible to use this with a normal Chrome/Chromium binary and ASGI server (such as [Uvicorn](https://www.uvicorn.org/) or [Hypercorn](https://pgjones.gitlab.io/hypercorn/), but my intention is to demonstrate a serverless example. \n\n*Note*: This is a proof-of-concept/example that I created to experiment with FastAPI and serverless. I do not intend to actively maintain it.\n\n## Usage\n\nLive: https://headless-api.eremieff.com/\n\nYou can play around with the generated API docs in the testing deployment docs to see how it works.\n\n\u003cimg src=\"https://github.com/jordaneremieff/headless-api/blob/main/assets/example.png?raw=true\" alt='Headless API example'\u003e\n\n\n\n## Serverless deployment\n\nYou'll need to modify the `serverless.yml` file and change occurences of `headless-api` in your project. I've only confirmed this working with 3.7 and have not tested other configurations.\n\nThe following binaries must be included in the `src/bin/` directory:\n\n```shell\ncurl -SL https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip \u003e chromedriver.zip\nunzip chromedriver.zip -d src/bin/\nrm chromedriver.zip\n```\n\n\n```shell\nmkdir -p bin/\ncurl -SL https://github.com/adieuadieu/serverless-chrome/releases/download/v1.0.0-37/stable-headless-chromium-amazonlinux-2017-03.zip \u003e headless-chromium.zip\nunzip headless-chromium.zip -d src/bin/\nrm headless-chromium.zip\n```\n\n## Running locally\n\nTo run the project locally, you'll need binaries specifc to your operation system and a normal ASGI server for the application. The local application can be run using Uvicorn:\n\n```shell\npython -m src.asgi\n```\n\n## Known Issues\n\n- It is currently not possible to screenshot all of the content on a page if the page height is greater than the window height size.\n\n- Some sites are likely able to detect the automated request and/or some other issues. For example, GitHub which displays \"an unsupported browser\" banner in a screenshot (only in the deployment). Not sure if this is related to the binaries or something else.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordaneremieff%2Fheadless-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjordaneremieff%2Fheadless-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjordaneremieff%2Fheadless-api/lists"}