jeffersongoncalves/laravel-semrush
A Laravel wrapper for the SEMrush API that lets you pull SEO, keyword, domain, and competitor data directly into your PHP applications through a clean, configurable interface.
get() → a deliberate hedge: any report not yet wrapped is still reachable, so roadmap items aren't blocked on package releases. Treat it as the escape valve for one-off or experimental reports, not as the primary interface.SEMRUSH_DATABASE); it adds no persistence or snapshotting. Any "trend over time," "change since last week," or alerting feature therefore needs our own storage layer — which is a separate roadmap item and should be scoped and estimated as such, not assumed to come free with the client.ERROR body is converted into a SemrushException, and transport/HTTP failures become RequestException. That distinction is exactly what a PM needs to specify differentiated UX (bad key or exhausted units vs. transient outage vs. bad query parameters) and to decide retry/backoff behavior.Adopt when most of the following hold:
SEMRUSH_API_KEY / SEMRUSH_DATABASE, plus the services.semrush.key fallback for apps that centralize third-party credentials in config/services.php). The fallback matters operationally: it means secrets can be managed the same way as every other service, rather than as a bespoke env var.Look elsewhere or plan to build wrapping layers when:
get() escape hatch covers occasional reports, but a core workflow built entirely on raw get() calls means we are effectively maintaining our own client through a thin proxy — at that point, evaluate whether a first-class client for that report family is a better investment.For executives (one paragraph): This is a small, low-risk integration library that lets our Laravel application pull competitive and keyword data from Semrush — the industry-standard SEO dataset — without building and maintaining that connection ourselves. It covers the three areas that matter for an SEO or competitive-intelligence feature: how large a site's search presence is, which keywords it wins and loses, and who it competes with for them. The engineering cost is minimal and the code surface is deliberately narrow, so it doesn't lock us into an architecture. The real decision it forces is commercial, not technical: Semrush API usage is metered, so any user-facing or automated feature needs a stated refresh cadence, caching policy, and cost ceiling before launch. Approve this as the plumbing; the accompanying decision to make is the monthly API budget and which features sit behind it.
For engineering (summary): A thin Laravel wrapper over the Semrush Analytics API. Typed methods for domain (domainOverview, domainOrganic, domainCompetitors), keyword (keywordOverview, relatedKeywords, keywordDifficulty), and backlink (backlinksOverview, backlinks) reports, plus a get() passthrough for anything else. Responses are semicolon-delimited CSV decoded into plain associative rows — no models, no DTOs, no persistence, so the mapping to our domain objects is ours to own. Error handling is already sensible and worth preserving: Semrush returns HTTP 200 with an ERROR body on failure, which this surfaces as SemrushException; non-2xx responses raise RequestException. That distinction lets us separate "fix the key / top up units / fix the query" from "retry later" — please keep it intact rather than collapsing to a single exception. Configuration is via SEMRUSH_API_KEY and SEMRUSH_DATABASE, with a services.semrush.key fallback so credentials can live in config/services.php alongside our other integrations. Explicitly out of scope and ours to build: caching, rate limiting, retry/backoff, unit-consumption monitoring, and any snapshotting needed for trend or change-over-time features. Recommend we treat the unit budget as a first-class non-functional requirement and add a caching layer before any endpoint is exposed to end users.
How can I help you explore Laravel packages today?