Skip to content

Universal SEO skill for Claude Code. 26 sub-skills + 19 sub-agents covering technical SEO, E-E-A-T, schema, GEO/AEO, agent readiness (Lighthouse Agentic Browsing, WebMCP, llms.txt), backlinks, local SEO, e-commerce, international SEO, Google APIs, and PDF/Excel reporting. 9 optional extensions for live SEO data.

fix(indexing): stop batches on quota responses

zhang.kom302ad5976368
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 648be42..923722f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
+### Fixed
+
+- Stop Indexing API batches after a quota response instead of sending more requests.
+
## [2.5.0] - 2026-10-22
Security and accuracy fixes from a full audit, and Claude Desktop installs again.
diff --git a/scripts/indexing_notify.py b/scripts/indexing_notify.py
index 35a840b..be56e2b 100644
--- a/scripts/indexing_notify.py
+++ b/scripts/indexing_notify.py
@@ -115,6 +115,7 @@ def notify_url(
"Also ensure the Indexing API is enabled in your GCP project."
)
elif "429" in error_str:
+ result["error_code"] = "quota_exceeded"
result["error"] = (
f"Quota exceeded. Daily limit: {DAILY_QUOTA} publish requests. "
"Check your quota in the Google API Console "
@@ -232,7 +233,9 @@ def batch_notify(
if notification.get("error"):
result["summary"]["error"] += 1
# Stop on quota errors
- if "429" in str(notification.get("error", "")):
+ if notification.get("error_code") == "quota_exceeded" or "429" in str(
+ notification.get("error", "")
+ ):
result["error"] = "Stopped: daily quota exceeded."
break
else:
diff --git a/tests/test_indexing_notify_quota.py b/tests/test_indexing_notify_quota.py
new file mode 100644
index 0000000..25de229
--- /dev/null
+++ b/tests/test_indexing_notify_quota.py
@@ -0,0 +1,51 @@
+import sys
+from pathlib import Path
+from unittest.mock import MagicMock
+
+from googleapiclient.errors import HttpError
+from httplib2 import Response
+
+sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "scripts"))
+import indexing_notify # noqa: E402
+
+
+def test_batch_stops_after_indexing_api_returns_429(monkeypatch):
+ service = MagicMock()
+ publish = service.urlNotifications.return_value.publish
+ publish.return_value.execute.side_effect = [
+ {"urlNotificationMetadata": {"latestUpdate": {"notifyTime": "2026-11-05T00:00:00Z"}}},
+ HttpError(Response({"status": "429"}), b'{"error":{"message":"quota exceeded"}}'),
+ {"urlNotificationMetadata": {}},
+ ]
+ monkeypatch.setattr(indexing_notify, "_build_indexing_service", lambda: service)
+ monkeypatch.setattr(indexing_notify, "validate_url", lambda _: True)
+ monkeypatch.setattr(indexing_notify.time, "sleep", lambda _: None)
+ urls = ["https://example.com/1", "https://example.com/2", "https://example.com/3"]
+
+ result = indexing_notify.batch_notify(urls)
+
+ assert publish.call_count == 2
+ assert result["summary"] == {"success": 1, "error": 1}
+ assert result["error"] == "Stopped: daily quota exceeded."
+ assert len(result["results"]) == 2
+ assert result["results"][1]["error_code"] == "quota_exceeded"
+ assert "Quota exceeded" in result["results"][1]["error"]
+
+
+def test_batch_continues_after_non_quota_error(monkeypatch):
+ service = MagicMock()
+ publish = service.urlNotifications.return_value.publish
+ publish.return_value.execute.side_effect = [
+ HttpError(Response({"status": "403"}), b'{"error":{"message":"forbidden"}}'),
+ {"urlNotificationMetadata": {}},
+ ]
+ monkeypatch.setattr(indexing_notify, "_build_indexing_service", lambda: service)
+ monkeypatch.setattr(indexing_notify, "validate_url", lambda _: True)
+ monkeypatch.setattr(indexing_notify.time, "sleep", lambda _: None)
+
+ result = indexing_notify.batch_notify(["https://example.com/1", "https://example.com/2"])
+
+ assert publish.call_count == 2
+ assert result["summary"] == {"success": 1, "error": 1}
+ assert "error_code" not in result["results"][0]
+ assert result["error"] is None