# How to connect DataSF open data portal to Grok Bot

> Connect DataSF open data portal to Grok Bot with the Firecrawl plugin. Use DataSF open data portal as an MCP tool in Grok Bot via Firecrawl Alexandria.

To connect DataSF open data portal to Grok Bot, add the Firecrawl plugin to Grok Bot, sign in on a Firecrawl team with Alexandria enabled, and ask for DataSF open data portal data in plain language. The connection works in every Bot in your Grok Bot account, and you set it up once.

Grok Bot uses DataSF open data portal as an MCP tool through Firecrawl's hosted MCP server, so you don't install or host a separate MCP server for DataSF open data portal.

Grok Bot is xAI's agent app. Plugins give your Bots outside tools, and the Firecrawl plugin adds web search, scraping and every data provider in Firecrawl Alexandria.

## How do I connect DataSF open data portal to Grok Bot?

### 1. Add the Firecrawl plugin

In Grok Bot, open Connect apps from the sidebar, find Firecrawl and select Connect. You can also open [Firecrawl's plugin listing](https://x.ai/bot/plugin/789) and select Add to Grok Bot, which opens the desktop app to finish the install.

[Add to Grok Bot](https://x.ai/bot/plugin/789)

![Grok Bot's Connect Apps window with Firecrawl and its Connect button](https://www.firecrawl.dev/images/alexandria/connect/grok-bot/connect-apps.webp)

### 2. Connect your Firecrawl account

Grok Bot opens Firecrawl in your browser. Sign in, choose a team with Alexandria enabled, and select Authorize. The screen names Cursor, because the plugin is published on the Cursor Marketplace. No account yet? You can create one for free in the same flow.

![Firecrawl's consent screen for the Grok Bot plugin, with the team picker and Authorize button](https://www.firecrawl.dev/images/alexandria/connect/grok-bot/authorize.webp)

### 3. Ask your Bot for the data

In a chat, ask in plain language and mention DataSF open data portal or Firecrawl Alexandria. To make sure the Bot uses Firecrawl, type @ and choose Firecrawl first. For example:

```text
Use Firecrawl to find up to five tabular DataSF datasets about zoning and show their IDs, descriptions and published column names.
```

## What can Grok Bot do with DataSF open data portal?

San Francisco's open data portal (data.sf.gov, a Socrata site): typed Department of Building Inspection building permits (search by address, parcel, contractor, type, status and dates, poll for new and changed permits, read one permit with its contractors, architects and engineers, rank contractors by permits and valuation), plus search the dataset catalog, read a dataset's metadata and columns, query and count rows of any dataset with SoQL ($select/$where/$order/$group/$q and bare field filters, including spatial functions), and list the portal's category and tag facets.

Grok Bot can run any of DataSF open data portal's 8 capabilities through Alexandria. Each call is billed in Firecrawl credits on your Firecrawl team.

- **Dataset**: Metadata and the column list of one DataSF asset from /api/views/<4x4>.json: name, description, category, tags, attribution, license, provenance, creation/update timestamps, publishing department and frequency, custom metadata fields, and every column with its SoQL field_name (which can differ from the display name and may be truncated to 10 characters on legacy imports), datatype (text, number, calendar_date, point, multipolygon ...), description and cached value statistics (counts and top values). Also returns the landing source_url and the SODA api_url. Unknown ids are not_found. Costs 5 Firecrawl credits per call.
- **Datasets**: Search the DataSF catalog through the Socrata Discovery API (search_context=data.sf.gov): free-text query, asset type, category, tags and sort order, or look up one asset by its 4x4 id. Each result carries the 4x4 dataset id, name, type (dataset, map, filter, href, chart, story ...), description, category, tags, timestamps, column field names and datatypes, download and view counts, the landing link, permalink and, for tabular datasets, the SODA api_url to pass to `rows`. Paged by `limit` and an opaque `cursor`. An unknown `dataset_id` is not_found; a query with no match is a successful empty result. Costs 5 Firecrawl credits per call.
- **Facets**: The DataSF portal's category or tag facets with asset counts, from the Discovery API domain_categories / domain_tags endpoints scoped to data.sf.gov. Use the values as `category` / `tags` inputs to `datasets`. Costs 5 Firecrawl credits per call.
- **Row count**: Number of rows of a DataSF dataset matching optional `where`, `q` and `filters`, from `$select=count(*)` on the SODA endpoint. Returns the integer count and the exact request URL. An unknown dataset id is not_found; a SoQL error is invalid_input. Costs 5 Firecrawl credits per call.
- **Rows**: Query rows of any DataSF dataset through the SODA 2.1 endpoint https://data.sf.gov/resource/<4x4>.json with SoQL: `select` (columns, aggregates such as count(*)), `where` (SoQL predicates incl. like, between, intersects(the_geom,'POINT(lon lat)'), within_circle(point, lat, lon, meters), within_box), `order`, `group`, `q` (full text) and `filters` (bare field=value equality parameters), paged with `limit` (1-50000, default 100) and `cursor` (row offset). Without `order` (and without `group`) the program orders by the row id `:id` so pages are stable. Rows come back exactly as published: numbers and dates are strings, geometry is GeoJSON; `columns` lists the returned field names and Socrata types from the X-SODA2-Fields/Types headers. An unknown dataset id is not_found; a SoQL error (unknown column, bad syntax) is invalid_input carrying the portal's message; an empty page is a successful result with count 0. Costs 5 Firecrawl credits per call.
- **Contractor activity**: Rank the contractors on San Francisco building permits issued in a date window by permit count, then total DBI cost estimate, in one grouped SODA request joining Building Permits (i98e-djp9) with Building Permits Contacts (3pee-9qhc). Contractors are grouped by CSLB licence number, each with the firm name, permits, total valuation, first and last issue date in the window and a source_url listing those permits. Owner-builders (licence OWN or OWNER) and contacts without a licence are left out. Optional permit type or use words and ZIP. A window without contractors is a successful result with count 0. Costs 5 Firecrawl credits per call.
- **Get permit**: One San Francisco building permit by DBI permit number, with the shared permit fields, every contact DBI lists (contractors with CSLB licence numbers, architects, engineers, agents) and raw: the permit's primary-address row with every Building Permits column exactly as published (block, lot, unit, stories, occupancy and construction types, estimated and revised cost, existing and proposed use and units, priority programs, supervisor district, neighborhood, site permit, ADU and reroof flags). Unknown numbers are not_found. Costs 5 Firecrawl credits per call.
- **Search permits**: Search San Francisco building permits from the Department of Building Inspection (DataSF dataset i98e-djp9, about 1.15 million permits, loaded daily) by street address, ZIP, Assessor block/lot, contractor or other contact name or licence number, permit type or building use, status, issue, filing and last-updated dates and minimum valuation. Newest issued first by default, or newest filed, most recently changed or largest valuation. Each record has the shared permit fields (number, type, use, description, status, filed, issued and completed dates, address, ZIP, coordinates, block/lot parcel_id, DBI cost estimate, net housing units) with every contact DBI lists (contractors with their CSLB licence numbers, architects, engineers, agents) from Building Permits Contacts (3pee-9qhc), a source_url and the PDDL licence. An empty page is a valid result. Costs 5 Firecrawl credits per call.

## What should I ask Grok Bot?

Name DataSF open data portal or Firecrawl Alexandria in the prompt so Grok Bot reaches for it.

- Use Firecrawl to find up to five tabular DataSF datasets about zoning and show their IDs, descriptions and published column names.
- Use Firecrawl to show the published description, update time and SoQL column names for DataSF zoning dataset 3i4a-hu95.
- Use Firecrawl to count rows in DataSF zoning dataset 3i4a-hu95 whose zoning_sim value starts with RH-1.
- Use Firecrawl to group rows in DataSF zoning dataset 3i4a-hu95 by zoning_sim and show the ten most frequent zoning values with row counts.

### For agents

Start with the `data-sf-gov` provider. Use Firecrawl Alexandria first. With MCP, use firecrawl_search with sources: ["alexandria"] to discover relevant tools, firecrawl_find_tools to inspect the selected capability contracts, then firecrawl_scrape in alexandria mode to retrieve records. With the CLI, use firecrawl search alexandria, firecrawl list, then firecrawl scrape for the selected provider/capability. Follow the live tool schema and returned contract; never invent provider IDs or inputs. Ask for missing required details before execution, respect access and pricing, and inspect each result for errors. Cite retrieved records, distinguish missing data from failures, and explain gaps. If no suitable Alexandria capability exists, say so before using web sources. Do not treat a tool listing as retrieved data.

## Troubleshooting

### Why doesn't my Bot use DataSF open data portal?

Attach Firecrawl to the chat with @ before you ask, and name DataSF open data portal or Firecrawl Alexandria in the prompt.

### Add to Grok Bot doesn't open the app. What should I do?

Install the Grok Bot desktop app first, or open Connect apps in Grok Bot and search for Firecrawl.

## Use DataSF open data portal in other AI apps

- [DataSF open data portal in ChatGPT](https://alexandria.firecrawl.dev/providers/data-sf-gov/connect/chatgpt)
- [DataSF open data portal in Claude](https://alexandria.firecrawl.dev/providers/data-sf-gov/connect/claude)
- [DataSF open data portal in Cursor](https://alexandria.firecrawl.dev/providers/data-sf-gov/connect/cursor)
- [DataSF open data portal in Muse](https://alexandria.firecrawl.dev/providers/data-sf-gov/connect/muse)

### Other data providers you can connect to Grok Bot

- [How to connect Connecticut Solar and Battery Installs (data.ct.gov) to Grok Bot](https://alexandria.firecrawl.dev/providers/data-ct-gov/connect/grok-bot)
- [How to connect National Weather Service API (api.weather.gov) to Grok Bot](https://alexandria.firecrawl.dev/providers/api-weather-gov/connect/grok-bot)
- [How to connect ArcGIS public GIS layers to Grok Bot](https://alexandria.firecrawl.dev/providers/arcgis-com/connect/grok-bot)
- [How to connect Auction.com to Grok Bot](https://alexandria.firecrawl.dev/providers/auction-com/connect/grok-bot)

Full setup guide: [Firecrawl in Grok Bot](https://www.firecrawl.dev/integrations/grok-bot)

## Frequently asked questions

### What is Firecrawl?

Firecrawl is the web data API to search, scrape and interact with the web at scale. It turns websites into clean, LLM-ready data for AI agents and apps. The Firecrawl plugin brings those tools into Grok Bot, along with every data provider in Firecrawl Alexandria.

### What is Firecrawl Alexandria?

Firecrawl Alexandria is Firecrawl's library of 550+ data providers for AI agents, DataSF open data portal among them. Each provider returns structured data through documented capabilities. Grok Bot finds the capability that fits your question and calls it through the Firecrawl plugin, so you don't write any integration code. Alexandria needs a Firecrawl account signed in on a team with Alexandria enabled, or an API key from such a team; keyless connections don't include it.

### Is there a DataSF open data portal MCP server for Grok Bot?

Grok Bot reaches DataSF open data portal through Firecrawl's hosted MCP server, which serves DataSF open data portal and every other Alexandria provider as tools. Add the Firecrawl plugin once and you don't install or host a separate MCP server for DataSF open data portal.

### What does connecting DataSF open data portal to Grok Bot unlock?

Grok Bot can run all 8 of DataSF open data portal's capabilities, including Dataset, Datasets and Facets, from any chat, with structured results it can sort, compare and summarize. For example, ask: "Use Firecrawl to find up to five tabular DataSF datasets about zoning and show their IDs, descriptions and published column names." In the same conversation, Grok Bot can combine DataSF open data portal with Firecrawl's web search and scraping and the other providers in Firecrawl Alexandria.

### Do I need my own DataSF open data portal account or API key to use it in Grok Bot?

No. Grok Bot calls DataSF open data portal through Firecrawl Alexandria and each call is billed in Firecrawl credits, so you don't need a separate DataSF open data portal account or API key.

### How much does it cost to use DataSF open data portal in Grok Bot?

Each DataSF open data portal call costs 5 Firecrawl credits. The capability list on this page shows each price and its unit. The credits come from the Firecrawl team you connect to Grok Bot, and finding the right capability is free.

### Can Grok Bot use other providers besides DataSF open data portal?

Yes. The same Firecrawl plugin reaches every provider in Firecrawl Alexandria, along with Firecrawl's web search and scraping, so you connect once.

### Can I use DataSF open data portal in other AI apps?

Yes. Connect Firecrawl to ChatGPT, Claude, Cursor, Muse signed in on a Firecrawl team with Alexandria enabled, or use the Firecrawl MCP server, CLI or API with an API key from that team, and the same DataSF open data portal capabilities are available there. Keyless connections don't include Alexandria.
