# API: Post code based search giving same result

**URL:** https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399
**Category:** Technical
**Tags:** query-tool, api
**Created:** [May 26, 2023, 5:35pm UTC](https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399 "2023-05-26T17:35:33Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sourav](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sourav](https://forum.openreferral.org/u/sourav)
#### Post date: [May 26, 2023, 5:35pm UTC](https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399/1 "2023-05-26T17:35:33Z")

</div>

It seems like postcode-based search results are the same for any postcode given. Please let me know how can I make the search more specific to a postcode.

---

<div class="post-metadata">

### Author: ![bloom](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openreferral.org/bloom/32/103_2.png) [@bloom](https://forum.openreferral.org/u/bloom)
#### Post date: [May 26, 2023, 6:22pm UTC](https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399/2 "2023-05-26T18:22:53Z")

</div>

Hi there – thanks for joining this forum, @sourav!

It sounds like you’re trying to search for specific resources on a particular website – is that the case?

There are many organiztaions in the Open Referral network with many different websites that have different approaches to search among them.

You may be referring to a particular bug or shortcoming on a particular website – possibly one associated with a pilot project we’re helping with, in which case I might be able to help make a connection with someone who can address your issue. But I’ll need more context – where are you encountering this issue?

thanks!

---

<div class="post-metadata">

### Author: ![MikeThacker-iStandUK](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openreferral.org/mikethacker-istanduk/32/8_2.png) [@MikeThacker-iStandUK](https://forum.openreferral.org/u/MikeThacker-iStandUK)
#### Post date: [June 2, 2023, 3:34pm UTC](https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399/3 "2023-06-02T15:34:33Z")

</div>

Hello @sourav Will you let me know the URL of the page or API call you are using to make the search please? Not all API feeds support all service filter options such as postcode. I can follow this up if I know where you’re looking.

Best wishes

---

<div class="post-metadata">

### Author: ![sourav](https://avatars.discourse-cdn.com/v4/letter/s/a4c791/32.png) [@sourav](https://forum.openreferral.org/u/sourav)
#### Post date: [June 5, 2023, 4:50am UTC](https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399/4 "2023-06-05T04:50:27Z")

</div>

Hi @MikeThacker basically, we want to use the filter by postcode & proximity  
i.e. `/services?postcode=SW1W0NY&proximity=5000`

But it seems like not getting the correct result. We tried the `Buckinghamshire Council` API.

---

<div class="post-metadata">

### Author: ![hntpx](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openreferral.org/hntpx/32/88_2.png) [@hntpx](https://forum.openreferral.org/u/hntpx)
#### Post date: [June 8, 2023, 3:31pm UTC](https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399/5 "2023-06-08T15:31:12Z")

</div>

Hi @sourav

We don’t have any support for proximity at the moment in the [Outpost API](https://github.com/wearefuturegov/outpost-api-service) yet.

You can pass in `/services?location=aylesbury` which fetches the lat/lng from google or you can pass through lat/lng `/services?lat=-0.808832&lng=51.816672`

You could then manually calculate proximity based on the lat/lng of the locations being returned (results return all locations assigned to a service)

I’m not sure yet which other endpoints support proximity.

---

<div class="post-metadata">

### Author: ![MikeThacker-iStandUK](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.openreferral.org/mikethacker-istanduk/32/8_2.png) [@MikeThacker-iStandUK](https://forum.openreferral.org/u/MikeThacker-iStandUK)
#### Post date: [June 13, 2023, 9:49am UTC](https://forum.openreferral.org/t/api-post-code-based-search-giving-same-result/399/6 "2023-06-13T09:49:11Z")

</div>

I think Placecube’s Open Place Directory supports “proximity”. In the small upgrade to the standard (officially version 3), we’ll make it clear which web methods and parameters we might consider standard and which are optional in individual implementations.
