# SEO Smoke Test for CI (`poyraz_demir/seo-smoke-ci`) Actor

Run deterministic SEO release checks with explicit PASS/FAIL results for HTTP, metadata, canonical, JSON-LD, internal links and sitemap.

- **URL**: https://apify.com/poyraz_demir/seo-smoke-ci.md
- **Developed by:** [Poyraz Demir](https://apify.com/poyraz_demir) (community)
- **Security:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 audited pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## SEO Smoke Test for CI

Run deterministic SEO release checks with explicit PASS/FAIL results for HTTP, metadata, canonical, JSON-LD, internal links and sitemap.

### What is SEO Smoke Test for CI?

SEO Smoke Test for CI checks public HTML pages against a fixed release contract. Instead of a subjective score, every check returns PASS or FAIL with machine-readable details. Use it to catch release regressions before they reach production: a lost meta description, a second canonical tag, a stray `noindex` or a broken internal link.

The Actor processes up to 20 URLs in input order. Each page produces one dataset record with its final URL, HTTP status, overall status, individual checks, number of links checked and elapsed time. Every run also saves a JUnit XML report, so a CI job can show each check as a test case.

### Checks included

The strict profile runs these checks in a fixed order:

1. `http`: the page returns a successful HTTP response with HTML content.
2. `title`: exactly one non-empty title is present.
3. `meta_description`: exactly one non-empty meta description is present.
4. `canonical`: exactly one canonical link is present.
5. `meta_robots`: the page does not contain `noindex`.
6. `json_ld`: at least one valid JSON-LD block is present.
7. `internal_links`: sampled same-origin links respond successfully.
8. `sitemap`: a readable sitemap contains at least one entry.

You can disable sitemap validation or set `maxLinks` to zero when those checks are outside your release contract. Missing elements are failures in the strict profile, not warnings.

### How to use it

1. Add the public page URLs you want to test. The example input checks `https://example.com/`, which fails several checks on purpose because it has no description, canonical link or JSON-LD.
2. Configure the request timeout, response-size limit, internal-link sampling and sitemap validation.
3. Run the Actor manually, through the Apify API or as a step in your deployment pipeline.
4. Treat a page-level `status` of `FAIL` as a failed smoke test and inspect the named checks for the reason.

In CI, call the Actor after each deployment, wait for the run to finish and download the `JUNIT` record from the run's key-value store. Most CI systems can display it as a test report.

### Input and output example

Input:

```json
{
  "urls": ["https://example.com/"],
  "timeoutSecs": 10,
  "maxBytes": 1000000,
  "maxLinks": 10,
  "checkSitemap": true,
  "respectRobotsTxt": true
}
```

The output record contains a `checks` array. For example, a missing description appears as:

```json
{
  "url": "https://example.com/",
  "finalUrl": "https://example.com/",
  "status": "FAIL",
  "httpStatus": 200,
  "checks": [
    {"name": "http", "status": "PASS", "details": {"httpStatus": 200}},
    {"name": "meta_description", "status": "FAIL", "details": {"count": 0}}
  ],
  "linksChecked": 0,
  "durationMs": 260,
  "error": null
}
```

The example is shortened to two checks; an actual strict run includes every enabled check. The JUnit report for the same two checks looks like this:

```xml
<testsuite name="seo-smoke" tests="2" failures="1">
  <testcase classname="seo-smoke.page" name="http (https://example.com/)" />
  <testcase classname="seo-smoke.page" name="meta_description (https://example.com/)">
    <failure message="meta_description failed">{"count": 0}</failure>
  </testcase>
</testsuite>
```

### Scope and access rules

This version does not run JavaScript, Lighthouse, Core Web Vitals, WCAG audits or external-link checks. It does not crawl a site: it checks only the submitted URLs, a sample of their internal links and the sitemap. It does not promise ranking improvements.

Only public pages are supported, with redirect validation, public-IP restrictions and optional robots.txt enforcement. The Actor does not log in, bypass anti-bot protection or use your cookies. Use it for your own sites or sites you are allowed to test, and stop if a site's terms or robots.txt rules disallow it.

### Pricing

Pay-per-event pricing: $0.0015 per Actor start plus $0.005 per audited page. A page is charged when the full audit runs, whether the result is PASS or FAIL. Pages that cannot be fetched, return an HTTP error or are not HTML are not charged. If a run reaches your maximum cost per run, the Actor stops after the last page that fits and still saves the JUnit report for the pages it checked.

### Troubleshooting and support

- A `FAIL` page status is a completed audit with at least one failed contract check, not necessarily an Actor error.
- Inspect the `name` and `details` fields of each check before changing the page configuration.
- Set `maxLinks` to zero for a metadata-only smoke test.
- Disable `checkSitemap` only when your release contract does not require a sitemap.
- Increase `timeoutSecs` for a slow public page or reduce the URL batch.

For bug reports, use Actor Issues in Apify Console. Include the run ID and the failing check name. Do not post private URLs, credentials or personal data.

# Actor input Schema

## `urls` (type: `array`):

Public HTTP/HTTPS pages to audit in input order.

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

Shared budget for robots, redirects and response reading; system DNS is checked immediately afterwards.

## `maxBytes` (type: `integer`):

Streaming response limit for page and sitemap downloads.

## `maxLinks` (type: `integer`):

Check same-origin links with status-only GET; zero disables link requests.

## `checkSitemap` (type: `boolean`):

Require a readable sitemap with at least one URL or sitemap entry per origin.

## `respectRobotsTxt` (type: `boolean`):

Check robots rules for pages, links, sitemaps and every redirect target.

## Actor input object example

```json
{
  "urls": [
    "https://example.com/"
  ],
  "timeoutSecs": 10,
  "maxBytes": 1000000,
  "maxLinks": 10,
  "checkSitemap": true,
  "respectRobotsTxt": true
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `junit` (type: `string`):

No description

# 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 = {
    "urls": [
        "https://example.com/"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("poyraz_demir/seo-smoke-ci").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 = { "urls": ["https://example.com/"] }

# Run the Actor and wait for it to finish
run = client.actor("poyraz_demir/seo-smoke-ci").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 '{
  "urls": [
    "https://example.com/"
  ]
}' |
apify call poyraz_demir/seo-smoke-ci --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,poyraz_demir/seo-smoke-ci"
        }
    }
}
```

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/bojf9LCC11rnXEO2o/builds/Lzq9Qcex3ldLPa04c/openapi.json
