> This page is for Developer.

> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.bigcommerce.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.bigcommerce.com/_mcp/server.

# Search Company Addresses

GET https://api-b2b.bigcommerce.com/api/v2/companies/{companyId}/addresses/searches

Returns all addresses associated with a Company account that match the query string `q`.

Equivalent Storefront GraphQL API Query: `addresses`. For more information, see the [GraphQL Playground](https://api-b2b.bigcommerce.com/graphql/playground).

Reference: https://docs.bigcommerce.com/developer/api-reference/rest/b2b/storefront/company/addresses/get-companies-company-id-addresses-searches

## Authentication

- `Authorization` header (bearer token, required) — ### Authentication header | Header | Argument | Description | | :-------------- | :------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `Authorization` | `Bearer {{B2B_JWT_TOKEN}}` | You can obtain this token using the steps described in the [REST Storefront API](/developer/docs/b2b-edition/getting-started/authentication#rest-storefront-api) section\[...] |

## Request

### Path parameters

- `companyId` (string, required) — The unique numeric ID of the Company account.

### Query parameters

- `q` (string, optional) — The search string for the request.
- `limit` (string, required) — The total number of items per page of the response.
- `offset` (string, required) — The number of items to skip before the current page of the response.

## Response

### 200

OK

- `message` (string, optional)
- `code` (double, optional, default: 200)
- `data` (CompaniesCompanyIdAddressesSearchesGetResponsesContentApplicationJsonSchemaData, optional)

## Types

### CompaniesCompanyIdAddressesSearchesGetResponsesContentApplicationJsonSchemaData

- `addressBookStatus` (string, optional)
- `defaultAddress` (companyAddressResponse, optional)
- `list` (list of companyAddressResponse, optional)
- `pagination` (responsePagination, optional)

### companyAddressResponse

- `companyId` (string, optional) — Unique numeric ID of the Company account.
- `companyName` (string, optional) — The name of the Company associated with the order's buyer.
- `companyAddress` (string, optional) — The local address information for the address.
- `companyCity` (string, optional) — City of the address.
- `companyState` (string, optional) — The name of the state, if applicable, for the address.
- `companyStateCode` (string, optional) — The state code, if applicable, for the address
- `companyZipCode` (string, optional) — Zip or Postal Code of the address.
- `companyCountry` (string, optional) — The name of the country for the address.
- `companyCountryCode` (string, optional) — The country code for the address
- `firstName` (string, optional) — The first name of the address.
- `lastName` (string, optional) — The last name of the address.
- `phoneNumber` (string, optional) — The phone number associated with the address.
- `label` (string, optional) — The label used on the storefront to identify the address.

### responsePagination

- `totalCount` (double, optional) — The total number of items matching the query.
- `offset` (double, optional) — The starting offset for the current page of the response.
- `limit` (double, optional) — The maximum number of items allowed per page of the response.

## Examples

**Response**

```json
{
  "message": "string",
  "code": 200,
  "data": {
    "addressBookStatus": "string",
    "defaultAddress": {
      "companyId": "123456",
      "companyName": "Great Buys",
      "companyAddress": "512 Bluebonnet Lane, Building 2",
      "companyCity": "Austin",
      "companyState": "Texas",
      "companyStateCode": "TX",
      "companyZipCode": "78726",
      "companyCountry": "United States",
      "companyCountryCode": "US",
      "firstName": "Marie",
      "lastName": "Curie",
      "phoneNumber": "8001234567",
      "label": "Austin Warehouse"
    },
    "list": [
      {
        "companyId": "123456",
        "companyName": "Great Buys",
        "companyAddress": "512 Bluebonnet Lane, Building 2",
        "companyCity": "Austin",
        "companyState": "Texas",
        "companyStateCode": "TX",
        "companyZipCode": "78726",
        "companyCountry": "United States",
        "companyCountryCode": "US",
        "firstName": "Marie",
        "lastName": "Curie",
        "phoneNumber": "8001234567",
        "label": "Austin Warehouse"
      }
    ],
    "pagination": {
      "totalCount": 175,
      "offset": 0,
      "limit": 10
    }
  }
}
```

**SDK Code**

```python
import requests

url = "https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches"

querystring = {"limit":"10","offset":"0"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches?limit=10&offset=0';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches?limit=10&offset=0"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches?limit=10&offset=0")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches?limit=10&offset=0")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches?limit=10&offset=0', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches?limit=10&offset=0");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api-b2b.bigcommerce.com/api/v2/companies/123/addresses/searches?limit=10&offset=0")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```