# Swift Package Index Scraper (`kawsar/swift-package-index-scraper`) Actor

Search and scrape Swift Package Index packages effortlessly. Enter your search query, set your item limit, and instantly extract clean package titles and URLs into JSON, CSV, or Excel formats.

- **URL**: https://apify.com/kawsar/swift-package-index-scraper.md
- **Developed by:** [Kawsar](https://apify.com/kawsar) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.99 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Swift Package Index Scraper

![Swift Package Index Scraper cover](https://images.bigibyte.com/cdn-cgi/image/width=1260,height=540,fit=cover,format=webp/apify-actors-covers/swift-package-index-scraper-cover.png)

Swift Package Index Scraper collects Swift package search results from publicly accessible Swift Package Index pages. Search by keyword or provide starting URLs, choose how many results to collect, and export package data in JSON, CSV, or Excel format.

### What It Does

The actor collects Swift package titles and URLs from search results. It supports keyword searches and custom starting URLs, making it useful for building package catalogs, researching Swift libraries, and monitoring search results.

### Modes

- **Search:** Find Swift packages using a search query.
- **Start URLs:** Collect package results from provided Swift Package Index list or search pages.

### Input Example

```json
{
  "url": "https://swiftpackageindex.com/r0ml/SwiftyPython",
  "packageTitle": "Python",
  "repository": "r0ml/SwiftyPython",
  "packageDescription": "Swift Package Manager package for embedding Python in Swift app",
  "activityStatus": "Active 2 years ago",
  "stars": 21,
  "scrapedAt": "2026-11-18T12:05:48.898611+00:00",
  "error": null
}
```

### Input Parameters

| Parameter | Description |
|---|---|
| `mode` | Collection mode. Use `search`. |
| `query` | Keyword used to find Swift packages. |
| `startUrls` | Optional list or search page URLs to collect results from. |
| `maxItems` | Maximum number of results to collect. |
| `requestDelayMs` | Delay between requests in milliseconds. |

### Output Example

```json
{
  "url": "https://swiftpackageindex.com/r0ml/SwiftyPython",
  "packageTitle": "Python",
  "scrapedAt": "2026-10-26T00:00:00+00:00"
}
```

### Output Fields

| Field | Description |
|---|---|
| `url` | URL of the Swift package page. |
| `packageTitle` | Package title displayed in the search result. |
| `scrapedAt` | Date and time the record was collected. |

### Use Cases

- **Package Research:** Collect package names and URLs related to a specific topic.
- **Catalog Building:** Create searchable catalogs of Swift packages.
- **Package Monitoring:** Refresh search results to track packages over time.
- **Data Analysis:** Export package records for spreadsheets, dashboards, and research.

### Frequently Asked Questions

**Who can use this actor?**

Swift developers, researchers, and analysts who need structured Swift Package Index search results.

**What data does it collect?**

It collects package titles and their corresponding page URLs, along with the source page and collection timestamp.

**Can I provide my own starting URLs?**

Yes. Use `startUrls` to collect results from supported Swift Package Index list or search pages.

**Can I schedule recurring runs?**

Yes. Apify schedules can automatically run the actor at your preferred intervals.

**Which export formats are available?**

You can export the collected dataset as JSON, CSV, Excel, and other supported Apify dataset formats.

### Trademark Notice

Swift Package Index and its related names and trademarks belong to their respective owners. This actor is an independent tool and does not imply affiliation, sponsorship, or endorsement.

### Is Web Scraping Legal?

This actor collects publicly accessible Swift package listing information without bypassing login screens, paywalls, or technical security measures. How collected information can be used depends on applicable laws and the source website's policies.

- **Personal Data:** Package listings may include maintainer names or other identifying information. If personal data is collected, consider applicable privacy laws such as GDPR and CCPA.
- **Copyright and Licensing:** Package descriptions, names, and related content may be protected by copyright or subject to individual licences. Follow applicable reuse, attribution, and licensing requirements.
- **Platform Terms and Rate Limits:** Respect Swift Package Index policies and terms, and keep collection activity reasonable.
- **Disclaimer:** This information is general guidance, not legal advice. Consult a qualified professional if you have questions about your intended use.

For more information, read Apify's guide: [Is web scraping legal?](https://blog.apify.com/is-web-scraping-legal/).

# Actor input Schema

## `mode` (type: `string`):

What to fetch. Search queries Swift packages on Swift Package Index.

## `query` (type: `string`):

Search query passed to Swift Package Index as `query` (tested value: java).

## `startUrls` (type: `array`):

Optional Swift Package Index list or search page URLs to parse instead of building one from the query.

## `maxItems` (type: `integer`):

Stop after this many successful rows. Hard max is 1000.

## `requestDelayMs` (type: `integer`):

Milliseconds to wait between requests. Raise if you see 429.

## `userAgent` (type: `string`):

User-Agent header sent with each request.

## `timeoutSecs` (type: `integer`):

Overall run budget in seconds.

## `requestTimeoutSecs` (type: `integer`):

Per-request timeout in seconds.

## `proxyConfiguration` (type: `object`):

Optional proxy. Leave off unless you need it.

## Actor input object example

```json
{
  "mode": "search",
  "query": "java",
  "maxItems": 100,
  "requestDelayMs": 1000,
  "userAgent": "ActorResearch/1.0",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

## `overview` (type: `string`):

Dataset rows in the overview table.

## `dataset` (type: `string`):

Full dataset for this run.

## `items` (type: `string`):

Dataset items as JSON.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "java"
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/swift-package-index-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "java" }

# Run the Actor and wait for it to finish
run = client.actor("kawsar/swift-package-index-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "java"
}' |
apify call kawsar/swift-package-index-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/swift-package-index-scraper"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/70PpFclHZUGONkqLn/builds/zdEMKJMNQXtIDQJkr/openapi.json
