PINGDOM_CHECK
ArticleProduct announcementProduct Update

Introducing ScrapyRT: An API for Scrapy Spiders

Introducing ScrapyRT: An API for Scrapy Spiders - Make the most of your Scrapy spiders with ScrapyRT. Explore its functionalities as an API for seamless integration.

Pablo Hoffman

1 min read ·

Introducing ScrapyRT: An API for Scrapy Spiders

Introducing ScrapyRT: An API for Scrapy spiders

We’re proud to announce our new open source project, ScrapyRT! ScrapyRT, short for Scrapy Real Time, allows you to extract data from a single web page via an API using your existing Scrapy spiders.

Why did we start this project?

We needed to be able to retrieve the latest data for a previously scraped page, on demand. ScrapyRT made this easy by allowing us to reuse our spider logic to extract data from a single page, rather than running the whole crawl again.

How does ScrapyRT work?

ScrapyRT runs as a web service and retrieving data is as simple as making a request with the URL you want to extract data from and the name of the spider you would like to use.

Let’s say you were running ScrapyRT on localhost, you could make a request like this:

1http://localhost:9080/crawl.json?spider_name=foo&url=http://example.com/product/1
Copy

ScrapyRT will schedule a request in Scrapy for the URL specified and use the ‘foo’ spider’s parse method as a callback. The data extracted from the page will be serialized into JSON and returned in the response body. If the spider specified doesn’t exist, a 404 will be returned. The majority of Scrapy spiders will be compatible without any additional programming necessary.

How do I use ScrapyRT in my Scrapy project?

1> git clone https://github.com/scrapinghub/scrapyrt.git > cd scrapyrt > pip install -r requirements.txt > python setup.py install > cd ~/your-scrapy-project > scrapyrt
Copy

ScrapyRT will be running on port 9080, and you can schedule your spiders per the example shown earlier.

We hope you find ScrapyRT useful and look forward to hearing your feedback!

Comment here or discuss on HackerNews.

Try Zyte API

Build your first scraper in minutes

Free trial, no credit card. From a single request to production in an afternoon.

Get started

Pablo Hoffman

Pablo has worked in open source for 13+ years. He founded Insophia in 2007 — the first Uruguayan company built exclusively on Python — where his team created and open-sourced Scrapy, now the standard Python web crawling framework. In 2010 he founded Scrapinghub (now Zyte) to buil…

More from this author

Continue reading

The Community · Newsletter

The best of Zyte and the data web, in your inbox.

One curated edition — new articles, product updates, and the stories shaping the data web. No noise.