Skip to content

Add similarweb extension#27452

Open
alexi-build wants to merge 5 commits intoraycast:mainfrom
alexi-build:ext/similarweb
Open

Add similarweb extension#27452
alexi-build wants to merge 5 commits intoraycast:mainfrom
alexi-build:ext/similarweb

Conversation

@alexi-build
Copy link
Copy Markdown
Contributor

@alexi-build alexi-build commented Apr 26, 2026

Description

Fetch Similarweb analytics, which include rankings, traffic trends, and audience insights for any website, and explore the locally stored history of your lookups.

Commads/Features

  • Show Website Data: Fetch website analytics for any domain or the active browser tab
  • History: Browse and manage previously fetched website snapshots stored locally
demo.yafw.balanced.mp4

Screencast

Checklist

@raycastbot
Copy link
Copy Markdown
Collaborator

Congratulations on your new Raycast extension! 🚀

We're currently experiencing a high volume of incoming requests. As a result, the initial review may take up to 10-15 business days.

Once the PR is approved and merged, the extension will be available on our Store.

@alexi-build alexi-build marked this pull request as ready for review April 26, 2026 22:23
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR adds a new Similarweb extension with two commands: Show Website Data (fetches analytics for a domain or active browser tab) and History (browses locally-stored snapshots). The code is well-structured with solid error handling, runtime type guards, and clean separation of concerns across api/, lib/, and the two command files.

  • P1 – misleading toast in show-website-data.tsx: when saveSnapshot fails, Toast.Style.Failure is displayed with the title \"Loaded website data\" — a red failure indicator whose title reads as a success, creating contradictory UX. The title should be changed to reflect the actual failure (e.g. \"Could Not Save Snapshot\").

Confidence Score: 4/5

Safe to merge after fixing the misleading toast title on snapshot save failure.

One P1 finding: the toast style/title mismatch when history persistence fails gives users contradictory signals about what went wrong. No P0 issues. All previously flagged concerns (missing categories, unused @raycast/utils) are resolved in the current state of the PR.

extensions/similarweb/src/show-website-data.tsx — misleading Toast.Style.Failure title on lines 62–66.

Important Files Changed

Filename Overview
extensions/similarweb/src/show-website-data.tsx Main command; contains a misleading Toast (Style.Failure + title "Loaded website data") when snapshot storage fails — contradictory UX signals.
extensions/similarweb/src/api/similarweb.ts Fetches from Similarweb's internal endpoint with spoofed browser headers; error handling is solid but the unofficial API surface is fragile and worth documenting.
extensions/similarweb/src/history.tsx History list command; loads, renders, deletes, and clears snapshots cleanly with confirmation dialogs.
extensions/similarweb/src/lib/history.ts LocalStorage persistence with dedup, size cap, and runtime type guard; well-structured.
extensions/similarweb/src/lib/format.ts Data normalization and Markdown formatting helpers; heuristic percent formatting is reasonable given the unofficial API schema.
extensions/similarweb/src/lib/domain.ts URL parsing and hostname validation; handles active-tab fallback and strips common subdomains correctly.
extensions/similarweb/package.json Correct schema reference, categories, platforms, and dependency list; previously flagged issues resolved.
Prompt To Fix All With AI
This is a comment left during a code review.
Path: extensions/similarweb/src/show-website-data.tsx
Line: 62-66

Comment:
**Misleading failure toast when snapshot save fails**

When the API fetch succeeds but `saveSnapshot` throws, the toast uses `Toast.Style.Failure` (red) with the title `"Loaded website data"`. Users see a red failure indicator whose title implies the data load itself succeeded — contradictory signals that will cause confusion about what actually went wrong. The title should reflect the actual failure.

```suggestion
        await showToast({
          style: Toast.Style.Failure,
          title: "Could Not Save Snapshot",
          message: "The snapshot could not be stored in local history.",
        });
```

How can I resolve this? If you propose a fix, please make it concise.

Reviews (2): Last reviewed commit: "refactor(format): replace formatNumber w..." | Re-trigger Greptile

Comment thread extensions/similarweb/src/show-website-data.tsx
Comment thread extensions/similarweb/package.json
Comment thread extensions/similarweb/package.json
Comment thread extensions/similarweb/src/api/similarweb.ts
@0xdhrv 0xdhrv self-assigned this Apr 28, 2026
Comment thread extensions/similarweb/src/show-website-data.tsx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants