# Codeberg Gitea Repos Scraper (`kawsar/codeberg-gitea-repos-scraper`) Actor

Search public repositories, detailed repo data, and user or organization profiles from Codeberg or any compatible Gitea/Forgejo instance. Export structured results directly to JSON, CSV, or Excel formats for easy analysis.

- **URL**: https://apify.com/kawsar/codeberg-gitea-repos-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

### Codeberg & Gitea Repositories Scraper

Find and extract public code repositories, developer profiles, and project details from Codeberg, Forgejo, or any self-hosted Gitea instance. Save structured dataset records directly to JSON, CSV, or Excel formats with automatic retries and built-in duplicate filtering.

### What You Can Do

- **Discover New Projects**: Search repositories by keyword, programming language, or topic while tracking stars, forks, primary language, and project URLs.
- **Track Watchlists**: Keep tabs on specific repositories over time to monitor activity and updates.
- **Extract Developer & Org Profiles**: Collect organization names, bio details, and websites without manually browsing through individual user pages.
- **Build Lead Lists**: Compile clean lists of project owners, organizations, and linked websites for developer outreach.
- **Work Across Instances**: Easily point to Codeberg or any custom Gitea/Forgejo host origin.

### Modes & Configuration

| Mode | Purpose |
|------|---------|
| `search` | Find repositories based on keywords, sorted by stars, updates, creation date, or forks. |
| `repo` | Retrieve specific repository details using `owner/repo` identifiers. |
| `user` | Pull profile details for individual users or organizations. |

#### Settings Breakdown

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `mode` | string | `search` | Choose `search`, `repo`, or `user` |
| `baseUrl` | string | `https://codeberg.org` | Target instance host origin |
| `query` | string | `python` | Keyword search query |
| `sort` | string | `stars` | Sort by `stars`, `updated`, `created`, or `forks` |
| `repos` | array | `forgejo/forgejo` | List of `owner/repo` items for repo mode |
| `users` | array | `forgejo` | Profile usernames or org names for user mode |
| `maxItems` | integer | `100` | Maximum rows to collect (capped at 1000) |
| `requestDelaySecs` | number | `1` | Delay between batch requests |
| `timeoutSecs` | integer | `300` | Max overall execution time |

#### Example Input Configuration

```json
{
  "mode": "search",
  "baseUrl": "[https://codeberg.org](https://codeberg.org)",
  "query": "python",
  "sort": "stars",
  "maxItems": 100,
  "requestDelaySecs": 1,
  "timeoutSecs": 300
}

```

### Output Data Structure

Extracted entries give you structured details about each repository or profile. If a single page or repository fails to load, an error row is created with detail messages instead of interrupting the rest of your run.

```json
{
  "id": 1043229,
  "full_name": "mi-skam/_gcp-python-uv",
  "repo_description": "Helper utilities for GCP Python deployments",
  "html_url": "[https://codeberg.org/mi-skam/_gcp-python-uv](https://codeberg.org/mi-skam/_gcp-python-uv)",
  "language": "Python",
  "stars_count": 12,
  "forks_count": 2,
  "open_issues_count": 0,
  "website": "[https://example.com](https://example.com)",
  "owner_login": "mi-skam",
  "created_at": "2025-12-18T12:44:43+01:00",
  "updated_at": "2025-12-18T12:44:51+01:00",
  "archived": false,
  "scraped_at": "2026-10-12T00:00:00+00:00"
}

```

#### Exported Fields

| Field | Type | Description |
| --- | --- | --- |
| `id` | integer | Unique identifier from the target instance |
| `full_name` | string | Full repository or profile name |
| `repo_description` | string | Project summary or user bio |
| `html_url` | string | Direct web URL |
| `language` | string | Primary programming language |
| `stars_count` | integer | Number of star ratings |
| `forks_count` | integer | Number of project forks |
| `open_issues_count` | integer | Number of unresolved issues |
| `website` | string | External website linked to project/owner |
| `owner_login` | string | Repository owner or organization username |
| `created_at` | string | Creation date timestamp |
| `updated_at` | string | Last modification timestamp |
| `archived` | boolean | Indicates whether the repo is archived |
| `scraped_at` | string | Timestamp when data was collected |

### How It Works

1. **Setup**: Reads your input parameters and caps the target total items safely to 1,000 records.
2. **Batch Fetching**: Processes pagination in batches, keeping request rates smooth and efficient.
3. **Smart Retries**: Automatically handles temporary connection glitches or server throttling with backoff pauses.
4. **Deduplication**: Filters duplicate IDs on the fly so your output dataset remains clean and unique.

### FAQ

**How many repositories can I extract in one run?**

By default, `maxItems` is set to 100, but you can increase it up to 1,000 items per run.

**What happens if a project or account doesn't exist?**

The scraper catches missing items gracefully, logging an error entry with status information without stopping the execution.

**Can I run this against self-hosted Gitea or Forgejo servers?**

Yes. Simply update `baseUrl` to point to the web address of your target server origin.

#### Trademark Notice

Codeberg, Gitea, Forgejo, and related names or logos belong to their respective owners. Their mention in this document is purely for descriptive purposes to identify platform compatibility and does not imply endorsement, affiliation, or partnership.

#### Disclaimer

This actor is an independent tool developed by kawsar. It is not affiliated with, sponsored by, or officially associated with Codeberg, Gitea, or Forgejo. All collected information comes from publicly available web pages. Users are responsible for complying with the target site's terms of service, acceptable use policies, and attribution guidelines.

#### Is web scraping legal?

This actor only collects publicly accessible information without bypassing technical barriers or access controls. Gathering public data is generally legal, but how you handle and process the extracted data matters:

- **Personal Data**: If your datasets contain personal information (such as names or contact links), privacy regulations like GDPR or CCPA may apply. Only process personal data when you have a legitimate purpose.
- **Copyright**: Content such as custom project documentation or articles may be protected by copyright. Avoid republishing full copyrighted materials without authorization.
- **Terms of Service**: Respect platform rate guidelines and attribution standards.
- **Legal Counsel**: This summary is provided for informational context and does not constitute formal legal advice. Consult a legal expert if you have specific regulatory concerns.

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

# Actor input Schema

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

What to collect: repository search, one or more owner/repo records, or user and organization profiles.

## `baseUrl` (type: `string`):

Origin of a public Gitea or Forgejo instance, such as https://codeberg.org. No path.

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

Text passed to repository search. Used only when mode is search.

## `sort` (type: `string`):

Repository search sort. Results are requested in descending order.

## `repos` (type: `array`):

owner/repo values, one per line. Used only when mode is repo.

## `users` (type: `array`):

User or organization logins, one per line. Used only when mode is user.

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

Maximum dataset rows for this run, including error rows. Hard cap is 1000.

## `requestDelaySecs` (type: `number`):

Seconds to wait after each HTTP call. Keeps the run inside the public rate limit.

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

User-Agent sent on every request. Include an app name and a contact address.

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

Stop scheduling new requests after this many seconds.

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

How long to wait for a single HTTP response before treating it as a failure.

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

Optional proxy. Leave Apify Proxy off unless the instance blocks the default IP.

## Actor input object example

```json
{
  "mode": "search",
  "baseUrl": "https://codeberg.org",
  "query": "python",
  "sort": "stars",
  "repos": [
    "forgejo/forgejo"
  ],
  "users": [
    "forgejo"
  ],
  "maxItems": 100,
  "requestDelaySecs": 1,
  "userAgent": "",
  "timeoutSecs": 300,
  "requestTimeoutSecs": 30,
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}
```

# Actor output Schema

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

Default dataset for this run.

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

Table of the first fields plus the source URL.

## `datasetItems` (type: `string`):

All 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 = {
    "baseUrl": "https://codeberg.org",
    "query": "python",
    "repos": [
        "forgejo/forgejo"
    ],
    "users": [
        "forgejo"
    ],
    "proxyConfiguration": {
        "useApifyProxy": false
    }
};

// Run the Actor and wait for it to finish
const run = await client.actor("kawsar/codeberg-gitea-repos-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 = {
    "baseUrl": "https://codeberg.org",
    "query": "python",
    "repos": ["forgejo/forgejo"],
    "users": ["forgejo"],
    "proxyConfiguration": { "useApifyProxy": False },
}

# Run the Actor and wait for it to finish
run = client.actor("kawsar/codeberg-gitea-repos-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 '{
  "baseUrl": "https://codeberg.org",
  "query": "python",
  "repos": [
    "forgejo/forgejo"
  ],
  "users": [
    "forgejo"
  ],
  "proxyConfiguration": {
    "useApifyProxy": false
  }
}' |
apify call kawsar/codeberg-gitea-repos-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kawsar/codeberg-gitea-repos-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/7ZFHYODGhL0GBbcjm/builds/fu6S2zqELpePv6Z82/openapi.json
