> 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/geolocation-guides/searching-by-location/find-events-by-latitude-longitude-and-radius.md).

# Find events by latitude/longitude and radius

For this example, we will find conferences and expos that happened within a 2 mile radius of a specific location, in April 2018.

{% hint style="success" %}
It is difficult working out a suitable radius around your location so to make it easier use our [Predicted Impact Area API](/api/impact-area/get-impact-area.md) to determine the optimal area around your business.
{% endhint %}

The Events endpoint supports the use of a `within` parameter to allow you to set specific latitude and longitude coordinates and search for events which occur within a radius from that point.

You can use this to find all the *conferences and expos*, `category=conferences,expos`, *within 2 miles* of my location, `within=2mi@-37.80036998,144.9715749`, that happened during *April of 2018*,`active.gte=2018-04-01&active.lte=2018-04-30`:

```python
import requests

response = requests.get(
    url="https://api.predicthq.com/v1/events/",
    headers={
      "Authorization": "Bearer $API_TOKEN",
      "Accept": "application/json"
    },
    params={
        "within" : "2mi@-37.80036998,144.9715749",
        "active.gte" : "2018-04-01",
        "active.lte" : "2018-04-30",
        "category" : "conferences,expos",
        "sort" : "rank"
    }
)

print(response.json())
```

The following snippet shows part of the results:

```json
{
  "count": 734,
  "results": [
    {
      "id": "SwBTYbfiAHYDdbkUi7",
      "title": "Great Debate: Political Interest Society vs History Society",
      "category": "conferences",
      ...
    }
  ]
}
```


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.predicthq.com/getting-started/guides/geolocation-guides/searching-by-location/find-events-by-latitude-longitude-and-radius.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
