Metadata-Version: 2.4
Name: scrapyrta
Version: 1.0.4
Summary: Asynchronous HTTP API for Running Scrapy Spiders
Project-URL: Repository, https://github.com/farhaduneci/scrapyrta
Project-URL: Releases, https://github.com/farhaduneci/scrapyrta/releases
Author-email: Farhad Uneci <farhaduneci@gmail.com>
License: MIT License
        
        Copyright (c) 2025 Farhad Uneci
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
License-File: LICENSE.txt
Keywords: fastapi,scrapy,scrapyrt
Classifier: Development Status :: 4 - Beta
Classifier: Framework :: FastAPI
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Requires-Dist: crochet>=2.1.1
Requires-Dist: fastapi>=0.115.12
Requires-Dist: pydantic>=2.11.3
Requires-Dist: python-environ>=0.4.54
Requires-Dist: requests>=2.32.3
Requires-Dist: scrapy>=2.8.0
Requires-Dist: uvicorn[standard]>=0.34.2
Description-Content-Type: text/markdown

# ScrapyRTA

[![PyPI Downloads](https://static.pepy.tech/badge/scrapyrta)](https://pepy.tech/projects/scrapyrta)

ScrapyRTA is an asynchronous HTTP API for running Scrapy spiders, built with FastAPI. It's a modern rewrite of the legacy [ScrapyRT](https://github.com/scrapinghub/scrapyrt) project, focusing on asynchronous operation and scalability.

## Features

-   Run Scrapy spiders via an Async HTTP API
-   Configurable request parameters

### API Endpoints

#### POST /crawl.json

Run a spider with specified parameters.

Example request:

```bash
curl --data '{"request": {"url": "http://quotes.toscrape.com/page/2/"}, "spider_name": "toscrape-css", "crawl_args": {"zipcode":"14000"}}' http://localhost:9080/crawl -v
```

> Have a look at `http://127.0.0.1:9080/docs` for more details and examples.

You can also create an `.env` file with the following content to alter ScrapyRTA behavior:

```text
SCRAPYRTA_DEBUG=False
SCRAPYRTA_LOG_LEVEL=INFO
SCRAPYRTA_ENABLE_OPEN_API=False

SCRAPYRTA_TIMEOUT_LIMIT=30 # seconds
```

## Notes

-   Requires `scrapy.cfg` in project directory, raises error if missing.
