     [Answers](https://scrapfly.io/blog)   /  [scrapy](https://scrapfly.io/blog/tag/scrapy)   /  [What are scrapy pipelines and how to use them?](https://scrapfly.io/blog/answers/what-are-scrapy-pipelines-and-how-to-use-them)   # What are scrapy pipelines and how to use them?

 by [Bernardas Alisauskas](https://scrapfly.io/blog/author/bernardas) Apr 25, 2023 1 min read [\#scrapy](https://scrapfly.io/blog/tag/scrapy) 

 [  ](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fwhat-are-scrapy-pipelines-and-how-to-use-them "Share on LinkedIn")    

 

 

Scrapy pipelines are data processing extensions that can modify scraped data before it's saved by scrapy spiders. Scrapy pipelines are often used to:

- Enhance scraped data with metadata fields. Like adding scraped item date.
- Validate scraped data for errors. Like checking scraped item fields.
- Store scraped data to a database or cloud storage. (not recommended, use feed exporters instead)

Most commonly pipelines are used to modify scraped data. For example, to add scrape datetime to every scraped item we could use this pipeline:

python```python
# define our pipeline code:
# pipelines.py
import datetime

class AddScrapedDatePipeline:
    def process_item(self, item, spider):
        current_utc_datetime = datetime.datetime.utcnow()
        item['scraped_date'] = current_utc_datetime.isoformat()
        return item

# settings.py
# activate pipeline in settings:
ITEM_PIPELINES = {
   'your_project_name.pipelines.AddScrapedDatePipeline': 300,
}
```



Pipelines are an easy and flexible way to control scrapy item output with very little extra code. Finally, here are some popular use cases for scrapy pipelines that can help you understand their potential:

- Use `cerberus` to validate scraped item fields.
- Use `pymongo` to store scraped items in MongoDB.
- Use google sheets API to store scraped items in Google Sheets.
- Raise `DropItem` exception to discard invalid scraped items.



 

    



Scale Your Web Scraping

Anti-bot bypass, browser rendering, and rotating proxies, all in one API. Start with 1,000 free credits.

  No credit card required  1,000 free API credits  Anti-bot bypass included 

 [Start Free](https://scrapfly.io/register) [View Docs](https://scrapfly.io/docs/onboarding) 

 Not ready? Get our newsletter instead. 

 

## Explore this Article with AI

 [ ChatGPT ](https://chat.openai.com/?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fwhat-are-scrapy-pipelines-and-how-to-use-them) [ Gemini ](https://www.google.com/search?udm=50&aep=11&q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fwhat-are-scrapy-pipelines-and-how-to-use-them) [ Grok ](https://x.com/i/grok?text=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fwhat-are-scrapy-pipelines-and-how-to-use-them) [ Perplexity ](https://www.perplexity.ai/search/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fwhat-are-scrapy-pipelines-and-how-to-use-them) [ Claude ](https://claude.ai/new?q=Summarize%20this%20page%3A%20https%3A%2F%2Fscrapfly.io%2Fblog%2Fanswers%2Fwhat-are-scrapy-pipelines-and-how-to-use-them) 



 ## Related Articles

 [  

 python xpath 

### Web Scraping With Scrapy: The Complete Guide in 2026

Tutorial on web scraping with scrapy and Python through a real world example project. Best practices, extension highligh...

 

 ](https://scrapfly.io/blog/posts/web-scraping-with-scrapy) [  

 python data-parsing 

### How to Ensure Web Scrapped Data Quality

Ensuring consitent web scrapped data quality can be a difficult and exhausting task. In this article we'll be taking a l...

 

 ](https://scrapfly.io/blog/posts/how-to-ensure-web-scrapped-data-quality) [  

 python headless-browser 

### Scrapy Splash Guide: Scrape Dynamic Websites With Scrapy

Learn about web scraping with Scrapy Splash, which lets Scrapy scrape dynamic web pages. We'll define Splash, cover inst...

 

 ](https://scrapfly.io/blog/posts/web-scraping-with-scrapy-splash) 

  ## Related Questions

- [ Q What are scrapy middlewares and how to use them? ](https://scrapfly.io/blog/answers/what-are-scrapy-middlewares-and-how-to-use-them)
- [ Q How to use headless browsers with scrapy? ](https://scrapfly.io/blog/answers/how-to-use-headless-browsers-with-scrapy)
- [ Q How to pass data between scrapy callbacks in Scrapy? ](https://scrapfly.io/blog/answers/how-to-pass-data-between-scrapy-callbacks)
- [ Q What are scrapy Item and ItemLoader objects and how to use them? ](https://scrapfly.io/blog/answers/what-are-scrapy-items-and-itemloaders)
 
  



   



 Scale your web scraping effortlessly, **1,000 free credits** [Start Free](https://scrapfly.io/register)