Sort Dataset Items

by lukaskrivka

Automatically sort your Apify scraper's dataset by any index field. A simple, open-source webhook actor to order your data effortlessly.

341 runs
19 users
Try This Actor

Opens on Apify.com

About Sort Dataset Items

Ever finish a scrape and realize your dataset is a jumbled mess? You need the items in a specific order for your next step, but manually sorting feels like busywork. That's where this little actor comes in. Think of it as your automated cleanup crew. You just add it as a webhook to your Apify scraper, tell it which field to use as the index (like a timestamp, ID, or priority number), and it automatically sorts your dataset items for you. It's perfect for when you're piping data into another system that expects a chronological order, or when you need to prioritize certain results before analysis. I use it to ensure my scraped product listings appear newest-first in reports, or to order real estate listings by price before sending them to a spreadsheet. It saves that annoying manual step and keeps your data pipelines flowing smoothly. It's open-source, so you can peek under the hood or tweak it if you need to, and it slots right into your existing Apify workflows without any fuss. Just set it and forget it.

What does this actor do?

Sort Dataset Items is a web scraping and automation tool available on the Apify platform. It's designed to help you extract data and automate tasks efficiently in the cloud.

Key Features

  • Cloud-based execution - no local setup required
  • Scalable infrastructure for large-scale operations
  • API access for integration with your applications
  • Built-in proxy rotation and anti-blocking measures
  • Scheduled runs and webhooks for automation

How to Use

  1. Click "Try This Actor" to open it on Apify
  2. Create a free Apify account if you don't have one
  3. Configure the input parameters as needed
  4. Run the actor and download your results

Documentation

Sort Dataset Items

This actor creates a new, sorted dataset from an existing Apify dataset. Since dataset items are immutable, this provides a way to reorder them, which is useful for maintaining the sequence of your Start URLs or any other logical order.

Key Features

  • Creates a new dataset with items sorted by a specified property (default: index).
  • Designed to run automatically via webhook after a scraper finishes.
  • Handles large datasets with configurable memory settings.

How to Use

Follow these steps to integrate the sorting process into your workflow:

  1. Prepare Your Data: Ensure each item in your original scraper's dataset contains a numeric property to sort by (e.g., index).
    javascript { "index": 1, "price": 2.35, "title": "my product" }

  2. Set Up the Webhook: Add this actor as a webhook in your scraper's settings.

    • Webhook URL: https://api.apify.com/v2/acts/lukaskrivka~sort-dataset-items/runs?token=YOUR_TOKEN
    • Replace YOUR_TOKEN with your actual Apify API token.
  3. Run: After your scraper finishes successfully, it will trigger this actor automatically. The actor will process the data and create a new, sorted dataset.

Input/Output

  • Input: The actor requires the defaultDatasetId as input, which is automatically provided when triggered via webhook from a parent actor run. It reads items from this dataset.
  • Output: The actor creates a new dataset named SORTED-{original-dataset-name}. This new dataset contains all items from the source, sorted in ascending order based on the index property.

Note on Performance: For sorting very large datasets, you may need to increase the actor's allocated memory. This can be done by creating and configuring a Task from this actor.

Common Use Cases

Market Research

Gather competitive intelligence and market data

Lead Generation

Extract contact information for sales outreach

Price Monitoring

Track competitor pricing and product changes

Content Aggregation

Collect and organize content from multiple sources

Ready to Get Started?

Try Sort Dataset Items now on Apify. Free tier available with no credit card required.

Start Free Trial

Actor Information

Developer
lukaskrivka
Pricing
Paid
Total Runs
341
Active Users
19
Apify Platform

Apify provides a cloud platform for web scraping, data extraction, and automation. Build and run web scrapers in the cloud.

Learn more about Apify

Need Professional Help?

Couldn't solve your problem? Hire a verified specialist on Fiverr to get it done quickly and professionally.

Find a Specialist

Trusted by millions | Money-back guarantee | 24/7 Support