> For the complete documentation index, see [llms.txt](https://docs.predicthq.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.predicthq.com/getting-started/guides/live-tv-event-guides/find-broadcasts-by-county-place-id.md).

# Find Broadcasts by County Place ID

For this example we want to find all broadcasts televised in two counties in California during November 2020.

The `location.place_id` parameter allows us to filter live sports events by their broadcast locations. For the counties in our example, we will use `location.place_id=5368381,5391832`, which are the respective Place IDs for Los Angeles County and San Diego County in California.

These Place IDs were found using the [Places API](/api/places/search-places.md). We provide a CSV file of broadcast counties to download, to make it easier to discover the `place_id` for all counties and states in the US.

{% file src="/files/pQOQG0XiC8DoFESe45FK" %}

We can also use the `start.*` parameters to filter broadcasts by time. For the time range in our example, we will use `start.gte=2020-11-01` and `start.lte=2020-11-30`. Using `start.tz=America/Los_Angeles` will treat the parameter’s start dates and times in the America/Los\_Angeles time zone, otherwise the parameter dates and times will be treated as UTC.

```python
import requests

response = requests.get(
    url="https://api.predicthq.com/v1/broadcasts/",
    headers={
        "Accept": "application/json",
        "Authorization": "Bearer $API_TOKEN"
    },
    params={
        "location.place_id": "5368381,5391832",
        "start.gte": "2020-11-01",
        "start.lte": "2020-11-30",
        "start.tz": "America/Los_Angeles"
    }
)

print(response.json())
```

A snippet of the results are shown below:

```json
{
  "count": 501,
  "next": "https://api.predicthq.com/v1/broadcasts/?location.place_id=5368381%2C5391832&start.gte=2020-11-01&start.lte=2020-11-30&start.tz=America%2FLos_Angeles&offset=10",
  "previous": null,
  "overflow": false,
  "results": [
    {
      "broadcast_id": "56aJFMBmajvnTjM3DUB4JS",
      "dates": {
        "start": "2020-11-01T18:00:00Z",
        "start_local": "2020-11-01T10:00:00",
        "timezone": "America/Los_Angeles"
      },
      "location": {
        "geopoint": {
          "lon": -118.26102,
          "lat": 34.19801
        },
        "place_hierarchies": [
          [
            "6295630",
            "6255149",
            "6252001",
            "5332921",
            "5368381"
          ]
        ],
        "places": [
          {
            "place_id": "5368381",
            "type": "county",
            "name": "Los Angeles County",
            "county": "Los Angeles County",
            "region": "California",
            "country": "US"
          }
        ],
        "country": "US"
      },
      "phq_viewership": 566891,
      "event": {
        "event_id": "24HwKWjyPw3xLBhGza",
        "title": "Los Angeles Rams vs Miami Dolphins",
        "category": "sports",
        "labels": [
          "american-football",
          "nfl",
          "sport"
        ],
        ...
      }
    },
    ...
  ]
}
```

In this example, the Broadcasts API found 501 broadcasts. The snippet shows one of the broadcasts: an NFL game where 56,6891 people will watch the broadcast.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.predicthq.com/getting-started/guides/live-tv-event-guides/find-broadcasts-by-county-place-id.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
