FastAPI service to extract and return cleaned text from HTML content using Goose3.
493
The FastAPI Goose3 HTML Content Extractor is a REST API service designed to extract and return cleaned text from HTML content. It leverages the power of FastAPI for high-performance HTTP handling and Goose3 for effective content extraction from HTML.
To run this Docker image, use the following command:
docker run -d -p 8000:8080 rbehzadan/extract-text-api:latest
This command will start the FastAPI application on port 8000.
Description: Extracts and returns the main text content from provided HTML.
Request:
/extract-textPOSTapplication/json{
"content": "<html><body><h1>Sample Article</h1><p>This is a sample paragraph.</p></body></html>"
}
Response:
application/json{
"text": "Sample Article\nThis is a sample paragraph."
}
You can customize the number of Uvicorn workers by setting the --workers flag (Default number of workers is 1). Modify the Docker run command if needed:
docker run -d -p 8000:8080 rbehzadan/extract-text-api:latest uvicorn main:app --host 0.0.0.0 --port 8080 --workers 4
Send a POST request to the /extract-text endpoint with the HTML content you want to process. The service will respond with the cleaned text.
The source code for this project is available on GitHub: https://github.com/rbehzadan/extract-text-api
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Please open an issue or submit a pull request on the GitHub repository for any changes.
Content type
Image
Digest
sha256:edafb8058…
Size
75 MB
Last updated
about 2 years ago
docker pull rbehzadan/extract-text-api