> For the complete documentation index, see [llms.txt](https://sfdigitalservices.gitbook.io/dataset-explainers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sfdigitalservices.gitbook.io/dataset-explainers/open-data-portal-website-update/updating-your-open-data-portal-api-queries-to-data.sf.gov.md).

# Updating your Open Data Portal API Queries to data.sf.gov

To keep your tools working after the Open Data Portal migration, you’ll need to update any API queries that reference data.sfgov.org. The steps below walk you through the full update process using exa

### Step-by-Step: Update Your API URLs

#### 1. Update the base domain

Anywhere you have:

```
https://data.sfgov.org
```

change it to:

```
https://data.sf.gov
```

#### 2. Find your dataset’s identifier

Each dataset has a unique 4x4 ID (for example `ydr8-5enu`). You can find this in the Open Data Portal:

* Open the dataset
* Click **Export → SODA API**
* Your API endpoint and dataset ID appear there

Reference:

* [SF Open Data “Developers” guidance](https://sfdigitalservices.gitbook.io/using-the-socrata-apis/using-the-socrata-apis)

#### 3. Update the API endpoint path

Most SODA API users will be using one of these:

**SODA2-style:**

```
https://data.sf.gov/resource/DATASET_ID.json
```

**SODA3-style:**

```
https://data.sf.gov/api/v3/views/DATASET_ID/query.json
```

Reference docs:

* [Socrata API overview](https://dev.socrata.com/docs/endpoints)

#### 4. Test your updated queries

Use a browser, Postman, cURL, or your app to test the updated URLs. A successful request returns JSON data.

#### 5. Update tokens or credentials

If you previously used an **App Token**, **API key**, or **username/password**, keep using them. Some SODA3 requests may require authentication.

#### 6. Deploy your updates

Roll out updated URLs across all scripts, dashboards, apps, and integrations. Check for:

* **404 errors** → typo or wrong dataset ID
* **401 errors** → missing API token
* **Empty responses** → incorrect endpoint type

#### 7. Complete your migration by **Nov 20, 2026**

After this date, `data.sfgov.org` API endpoints will stop working.

***

### Troubleshooting Tips

* **404 Not Found**: Check dataset ID and endpoint path.
* **Query errors**: Confirm SoQL syntax.
* **Slow responses**: Add filters or limits.
* **Auth problems**: Check your App Token.

***

### Helpful Links

* [**Open Data Portal**](https://data.sf.gov/)
* [**Open Data Migration Explainer**](https://sfdigitalservices.gitbook.io/dataset-explainers/open-data-portal-website-update)
* [**Using the SODA API**](https://sfdigitalservices.gitbook.io/using-the-socrata-apis/using-the-socrata-apis)
* [**Socrata Developer Docs**](https://dev.socrata.com/docs/endpoints)
* **Contact support**: <support@datasf.org>
