# Buggy Queries

### Get All Buggy Brands

This call returns a list of Buggy Brands.

The returned results include a buggy brand `id`. These returned values can be used in other API calls where `[BRANDID]` is required.

There are no mandatory or optional parameters for this query.

#### HTTP Request

`https://api.mybuggymycar.com/api/search.php?s=getbuggybrands`

{% hint style="info" %}
**Counts against quota**: No
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api.mybuggymycar.com/api/search.php?s=getbuggybrands' \
--header 'Authorization: Basic YOUR_BASE64_KEY'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();

$request->setUrl('https://api.mybuggymycar.com/api/search.php?s=getbuggybrands');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic YOUR_BASE64_KEY'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}ph
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.mybuggymycar.com")
payload = ''
headers = {
  'Authorization': 'Basic YOUR_BASE64_KEY'
}
conn.request("GET", "/api/search.php?s=getbuggybrands", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.mybuggymycar.com/api/search.php?s=getbuggybrands");
xhr.setRequestHeader("Authorization", "Basic YOUR_BASE64_KEY");

xhr.send();
```

{% endtab %}
{% endtabs %}

> Make sure to replace `YOUR_BASE64_KEY` with your API key.
>
> The above command returns JSON structured like this:

```javascript
{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR NAME",
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",         
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "226"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "type": "Return Buggy Brands"
    },
    "results": [
        {
            "id": "xxxxxxx",
            "brand_name": "ABC Design"
        },
        {
            "id": "xxxxxxx",
            "brand_name": "Ark"
        },
        {
            "id": "xxxxxxx",
            "brand_name": "Asalvo"
        },
        {
            "id": "xxxxxxx",
            "brand_name": "BabaBing"
        },
        {
            "id": "xxxxxxx",
            "brand_name": "Baby Elegance"
        },
        {
            "id": "xxxxxxx",
            "brand_name": "Baby Jogger"
        }
    ]
}
```

### Get Buggy Models List

Get the Buggy Models for a given Buggy Brand ID. This provides a limited result array and is intended to support searching/identification of a buggy e.g. perhaps for use in a Drop Down List. For more detailed buggy responses, use [`Get Buggy Models`](#get-buggy-models).

The Brand ID should match a value returned from the [`getBuggyBrands`](#get-all-buggy-brands) call.

Optionally you can specify the sort order that the buggy models should be returned in and also whether to include the variants of a given buggy model. You could also make use of the [`getVariants`](#get-buggy-model-variants) call to subsequently return a list of model variants if needed.

#### HTTP Request

`https://api.mybuggymycar.com/api/search.php?s=getbuggymodelslist&brandid=<BRANDID>&sort=<SORT>&variants=<VARIANTS>&double=<DOUBLE>&shrink=<SHRINK>&available=<AVAILABLE>`

#### URL Parameters

| Parameter | Type    | Required? | Default | Description                                                                                                                                                                                                                                                                                                                          |
| --------- | ------- | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| brandid   | Integer | Yes       | N/A     | A valid Buggy Brand ID.  Use [`getBuggyBrands`](#get-all-buggy-brands) to identify a valid ID                                                                                                                                                                                                                                        |
| sort      | String  | Optional  | ASC     | Sorts the order that Buggy Models are returned in (buggy\_model\_name).  Use ASC for Ascending or DESC for Descending.  If excluded, will default to ASC.                                                                                                                                                                            |
| variants  | Integer | Optional  | 0       | Specify whether to return all Buggy Model variants e.g. return the black, red, green, yellow models instead of just returning the one model.  Useful if you want to do price comparisons of all versions available, but generally speaking omitting this is all that would be needed. Use `1` to include, use `0` to exclude.        |
| double    | Integer | Optional  | 2       | Specify where to return single occupancy buggy's only (`0`), double buggy's only (`1`) or all types (`2`).                                                                                                                                                                                                                           |
| shrink    | Integer | Optional  | 0       | Specify whether to use standard folded measurements or whether to use the smallest possible measurements (e.g remove wheels or handles).  Note - if the manufacturer hasn't advised of removable components, the standard measurements will be used.  Use `1` to use the smallest buggy dimensions, use `0` to use standard.         |
| available | String  | Optional  | prices  | Specify whether to return models where My Buggy My Car has found UK retailers currently selling each model.  Use `prices`to only show models that have a price.  Use `all` to return all models regardless of availability.  Note, this option is available regardless of whether your subscription plan offers pricing information. |

{% hint style="info" %}
**Counts against quota**: No
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api.mybuggymycar.com/api/search.php?s=getbuggymodelslist&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>' \
--header 'Authorization: Basic YOUR_BASE64_KEY'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();

$request->setUrl('https://api.mybuggymycar.com/api/search.php?s=getbuggymodelslist&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic YOUR_BASE64_KEY'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.mybuggymycar.com")
payload = ''
headers = {
  'Authorization': 'Basic YOUR_BASE64_KEY'
}
conn.request("GET", "/api/search.php?s=getbuggymodelslist&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.mybuggymycar.com/api/search.php?s=getbuggymodelslist&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>");
xhr.setRequestHeader("Authorization", "Basic YOUR_BASE64_KEY");

xhr.send();
```

{% endtab %}
{% endtabs %}

> Make sure to replace `<BRANDID>` with a valid Brand ID and `YOUR_BASE64_KEY` with your API key.
>
> The above command returns JSON structured like this:

```javascript
{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR_NAME",
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",         
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "227"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "search_type": "Return Buggy Models List",
        "brand_id": "2",
        "brand_name": "Baby Jogger",
        "show_buggy_variants": "No",
        "buggy_occupancy": "All Buggy's",
        "buggy_dimensions": "Standard measurements",
        "buggy_availablity": "With Prices"
    },
    "results": [
        {
            "buggy_model_id": "xxxxxxx",
            "brand_name": "Baby Jogger",
            "buggy_model_name": "City Elite",
            "buggy_variant_name": "Red",
            "buggy_variant_colour": "Red",
            "buggy_model_isdouble": "No",
            "buggy_folded_dimensions": "85.00 x 67.50 x 35.50"
        },
        {
            "buggy_model_id": "xxxxxxx",
            "brand_name": "Baby Jogger",
            "buggy_model_name": "City Elite 2",
            "buggy_variant_name": "Black",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_folded_dimensions": "85.00 x 67.50 x 35.50"
        },
        {
            "buggy_model_id": "xxxxxxx",
            "brand_name": "Baby Jogger",
            "buggy_model_name": "City Mini",
            "buggy_variant_name": "Crimson",
            "buggy_variant_colour": "Red",
            "buggy_model_isdouble": "No",
            "buggy_folded_dimensions": "85.00 x 67.50 x 35.50"
        },
        {
            "buggy_model_id": "xxxxxxx",
            "brand_name": "Baby Jogger",
            "buggy_model_name": "City Mini 2",
            "buggy_variant_name": "Jet",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_folded_dimensions": "85.00 x 67.50 x 35.50"
        },
        {
            "buggy_model_id": "xxxxxxx",
            "brand_name": "Baby Jogger",
            "buggy_model_name": "City Mini 2 4 Wheel",
            "buggy_variant_name": "Jet",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_folded_dimensions": "85.00 x 67.50 x 35.50"
        }
    ]
}
```

### Get Buggy Models

Get the Buggy Models for a given Buggy Brand ID. This provides the same results as the [Get Buggy Models List](#get-buggy-models-list) query above, but this returns more detailed information (including image links) for each buggy.

The Brand ID should match a value returned from the [`getBuggyBrands`](#get-all-buggy-brands) call.

Optionally you can specify the sort order that the buggy models should be returned in and also whether to include the variants of a given buggy model. You could also make use of the [`getVariants`](#get-buggy-model-variants) call to subsequently return a list of model variants if needed.

#### HTTP Request

`https://api.mybuggymycar.com/api/search.php?s=getbuggymodels&brandid=<BRANDID>&sort=<SORT>&variants=<VARIANTS>&double=<DOUBLE>&shrink=<SHRINK>&available=<AVAILABLE>`

#### URL Parameters

| Parameter | Type    | Required? | Default | Description                                                                                                                                                                                                                                                                                                                          |
| --------- | ------- | --------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| brandid   | Integer | Yes       | N/A     | A valid Buggy Brand ID.  Use [`getBuggyBrands`](#get-all-buggy-brands) to identify a valid ID                                                                                                                                                                                                                                        |
| sort      | String  | Optional  | ASC     | Sorts the order that Buggy Models are returned in (buggy\_model\_name).  Use ASC for Ascending or DESC for Descending.  If excluded, will default to ASC.                                                                                                                                                                            |
| variants  | Integer | Optional  | 0       | Specify whether to return all Buggy Model variants e.g. return the black, red, green, yellow models instead of just returning the one model.  Useful if you want to do price comparisons of all versions available, but generally speaking omitting this is all that would be needed. Use `1` to include, use `0` to exclude.        |
| double    | Integer | Optional  | 2       | Specify where to return single occupancy buggy's only (`0`), double buggy's only (`1`) or all types (`2`).                                                                                                                                                                                                                           |
| shrink    | Integer | Optional  | 0       | Specify whether to use standard folded measurements or whether to use the smallest possible measurements (e.g remove wheels or handles).  Note - if the manufacturer hasn't advised of removable components, the standard measurements will be used.  Use `1` to use the smallest buggy dimensions, use `0` to use standard.         |
| available | String  | Optional  | prices  | Specify whether to return models where My Buggy My Car has found UK retailers currently selling each model.  Use `prices`to only show models that have a price.  Use `all` to return all models regardless of availability.  Note, this option is available regardless of whether your subscription plan offers pricing information. |

{% hint style="info" %}
**Counts against quota**: Yes
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api.mybuggymycar.com/api/search.php?s=getbuggymodels&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>' \
--header 'Authorization: Basic YOUR_BASE64_KEY'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();

$request->setUrl('https://api.mybuggymycar.com/api/search.php?s=getbuggymodels&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic YOUR_BASE64_KEY'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.mybuggymycar.com")
payload = ''
headers = {
  'Authorization': 'Basic YOUR_BASE64_KEY'
}
conn.request("GET", "/api/search.php?s=getbuggymodels&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.mybuggymycar.com/api/search.php?s=getbuggymodels&brandid=<BRANDID>&sort=<SORT>&double=<DOUBLE>&shrink=<SHRINK>variants=<VARIANTS>&available=<AVAILABLE>");
xhr.setRequestHeader("Authorization", "Basic YOUR_BASE64_KEY");

xhr.send();
```

{% endtab %}
{% endtabs %}

> Make sure to replace `<BRANDID>` with a valid Brand ID and `YOUR_BASE64_KEY` with your API key.
>
> The above command returns JSON structured like this:

```javascript
{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR_NAME",
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",         
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "227"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "search_type": "Return Buggy Models",
        "brand_id": "2",
        "brand_name": "Baby Jogger",
        "show_buggy_variants": "No",
        "buggy_occupancy": "All Buggy's",
        "buggy_dimensions": "Standard measurements",
        "buggy_availability": "With Prices"
    },
    "results": [
        {
            "brand_id": "2",
            "brand_name": "Baby Jogger",
            "buggy_model_id": "678",
            "buggy_model_name": "City Elite",
            "buggy_variant_name": "Black",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "11.90",
            "buggy_max_weight_kg": "15.00",
            "buggy_suitability": "From birth",
            "buggy_folded_dimensions": "85.00 x 67.50 x 35.50",
            "folded_length": "85.00",
            "folded_depth": "67.50",
            "folded_height": "35.50",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/baby-jogger/678-baby-jogger-City_Elite--black...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/baby-jogger/678-baby-jogger-City_Elite--black_liUYxPyyF.jpg..."
            }
        },
        {
            "brand_id": "2",
            "brand_name": "Baby Jogger",
            "buggy_model_id": "5665",
            "buggy_model_name": "City Elite 2",
            "buggy_variant_name": "Granite",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "11.70",
            "buggy_max_weight_kg": "22.00",
            "buggy_suitability": "From Birth",
            "buggy_folded_dimensions": "82.00 x 68.00 x 36.70",
            "folded_length": "82.00",
            "folded_depth": "68.00",
            "folded_height": "36.70",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/baby-jogger/5665-baby-jogger-City_Elite_2--black...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/baby-jogger/5665-baby-jogger-City_Elite_2--black..."
            }
        },
        {
            "brand_id": "2",
            "brand_name": "Baby Jogger",
            "buggy_model_id": "5044",
            "buggy_model_name": "City Mini 2",
            "buggy_variant_name": "Jet",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "9.40",
            "buggy_max_weight_kg": "0.00",
            "buggy_suitability": "From Birth",
            "buggy_folded_dimensions": "77.00 x 66.00 x 23.50",
            "folded_length": "77.00",
            "folded_depth": "66.00",
            "folded_height": "23.50",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/baby-jogger/5044-baby-jogger-City_Mini_2--black...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/baby-jogger/5044-baby-jogger-City_Mini_2--black..."
            }
        }
    ]
}
```

### Get Buggy Model Variants

Get the Buggy Model Variants for a given Buggy Model ID.

The Buggy Model ID should match a value returned from the [`getBuggyModelsList`](#get-buggy-models-list) or [`getBuggyModels`](#get-buggy-models) call.  Alternatively you can specify the Buggy Brand and Model name as defined in [`getBuggyBrand`](#get-all-buggy-brands) and the [`getBuggyModelsList`](#get-buggy-models-list) or [`getBuggyModels`](#get-buggy-models) calls

Optionally you can specify the sort order that the buggy model variants should be returned by.

#### HTTP Request

`https://api.mybuggymycar.com/api/search.php?s=getvariants&buggyid=<BUGGYID>&sort=<SORT>&available=<AVAILABLE>`

#### OR

`https://api.mybuggymycar.com/api/search.php?s=getvariants&brand=<brandname>&model=<modelname>&sort=<SORT>&available=<AVAILABLE>`

#### URL Parameters

| Parameter | Type    | Required?        | Default | Description                                                                                                                                                                                                                                                                                                                          |
| --------- | ------- | ---------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| buggyid   | Integer | Yes (alternate)  | N/A     | A valid Buggy Model ID.  Use [`getBuggyModelsList`](#get-buggy-models-list) [`getBuggyModels`](#get-buggy-models) to identify a valid ID.  Alternatively, specify `brand` name and `model` name                                                                                                                                      |
| brand     | String  | Yes (alternate)  | N/A     | URL encoded brand name as defined in [`getBuggyBrand`](#get-all-buggy-brands)                                                                                                                                                                                                                                                        |
| model     | String  | Yes (with brand) | N/A     | URL encoded model name as defined in [`getBuggyModelsList`](#get-buggy-models-list)or[`getBuggyModels`](#get-buggy-models)                                                                                                                                                                                                           |
| sort      | String  | Optional         | ASC     | Sorts the order that Buggy Models are returned in (buggy\_model\_name).  Use ASC for Ascending or DESC for Descending.  If excluded, will default to ASC.                                                                                                                                                                            |
| available | String  | Optional         | prices  | Specify whether to return models where My Buggy My Car has found UK retailers currently selling each model.  Use `prices`to only show models that have a price.  Use `all` to return all models regardless of availability.  Note, this option is available regardless of whether your subscription plan offers pricing information. |

{% hint style="info" %}
**Counts against quota**: Yes
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api.mybuggymycar.com/api/search.php?s=getvariants&buggyid=<BUGGYID>&sort=<SORT>&available=<AVAILABLE>' \
--header 'Authorization: Basic YOUR_BASE64_KEY'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();

$request->setUrl('https://api.mybuggymycar.com/api/search.php?s=getvariants&buggyid=<BUGGYID>&sort=<SORT>&available=<AVAILABLE>');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic YOUR_BASE64_KEY'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.mybuggymycar.com")
payload = ''
headers = {
  'Authorization': 'Basic YOUR_BASE64_KEY'
}
conn.request("GET", "/api/search.php?s=getvariants&buggyid=<BUGGYID>&sort=<SORT>&available=<AVAILABLE>", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.mybuggymycar.com/api/search.php?s=getvariants&buggyid=<BUGGYID>&sort=<SORT>&available=<AVAILABLE>");
xhr.setRequestHeader("Authorization", "Basic YOUR_BASE64_KEY");

xhr.send();
```

{% endtab %}
{% endtabs %}

> Make sure to replace `<BUGGYID>` with a valid Buggy Model ID and `YOUR_BASE64_KEY` with your API key.
>
> The above command returns JSON structured like this:

```javascript
{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR_NAME",
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",         
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "230"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "type": "Return Buggy Model Variants",
        "brand_id": "35",
        "brand_name": "Phil and Teds",
        "buggy_model_id": "556",
        "buggy_availability": "All"
    },
   "results": [
        {
            "brand_id": "35",
            "brand_name": "Phil and Teds",
            "buggy_model_id": "554",
            "buggy_model_name": "mod",
            "buggy_variant_name": "Abstract",
            "buggy_variant_colour": "Green",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "12.00",
            "buggy_max_weight_kg": "20.00",
            "buggy_suitability": "Birth to 4 Years",
            "buggy_folded_dimensions": "71.00 x 57.00 x 32.00",
            "folded_length": "71.00",
            "folded_depth": "57.00",
            "folded_height": "32.00",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/phil-and-teds/554-phil-and-teds-mod--green...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/phil-and-teds/554-phil-and-teds-mod--green..."
            }
        },
        {
            "brand_id": "35",
            "brand_name": "Phil and Teds",
            "buggy_model_id": "557",
            "buggy_model_name": "mod",
            "buggy_variant_name": "Capri",
            "buggy_variant_colour": "Green",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "12.00",
            "buggy_max_weight_kg": "20.00",
            "buggy_suitability": "Birth to 4 Years",
            "buggy_folded_dimensions": "71.00 x 57.00 x 32.00",
            "folded_length": "71.00",
            "folded_depth": "57.00",
            "folded_height": "32.00",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/phil-and-teds/557-phil-and-teds-mod--green_...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/phil-and-teds/557-phil-and-teds-mod--green..."
            }
        },
        {
            "brand_id": "35",
            "brand_name": "Phil and Teds",
            "buggy_model_id": "555",
            "buggy_model_name": "mod",
            "buggy_variant_name": "Noir",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "12.00",
            "buggy_max_weight_kg": "20.00",
            "buggy_suitability": "Birth to 4 Years",
            "buggy_folded_dimensions": "71.00 x 57.00 x 32.00",
            "folded_length": "71.00",
            "folded_depth": "57.00",
            "folded_height": "32.00",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/phil-and-teds/555-phil-and-teds-mod--black...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/phil-and-teds/555-phil-and-teds-mod--black..."
            }
        }
    ]
}
```

### Search for Buggies By Car

Returns a list of Buggy Models that will fit into the specified Car ID or Car Registration Number (VRM)

The returned json includes confirmation of the car that was searched for.

**Note**, the `carid` must be identified using the [Car ID Lookup](https://docs.api.mybuggymycar.com/car-queries#carid-lookups) searches. Alternatively, you could use the `vrm` parameter which will perform this lookup.

#### HTTP Request

`https://api.mybuggymycar.com/api/search.php?s=searchbycar&vrm=<VRM>&space=<OPTIONAL>&sort=<OPTIONAL>&brand=<OPTIONAL>&variants=<OPTIONAL>&double=<OPTIONAL>&shrink=<OPTIONAL>&available=<OPTIONAL>` \
\
**OR**\
&#x20;`https://api.mybuggymycar.com/api/search.php?s=searchbycar&carid=<CARID>&space=<OPTIONAL>&sort=<OPTIONAL>&brand=<OPTIONAL>&variants=<OPTIONAL>&double=<OPTIONAL>&shrink=<OPTIONAL>&available=<OPTIONAL>`

#### URL Parameters

| Parameter | Type    | Required?      | Default           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    |
| --------- | ------- | -------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| carid     | Integer | Yes (or VRM)   | N/A               | A valid `carid`.  The `carid` corresponds to a car id that can be identified using the [Car ID Lookup](https://docs.api.mybuggymycar.com/car-queries#carid-lookups) searches.  Alternatively, use the `vrm` parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| vrm       | String  | Yes (or carid) | N/A               | An alternative to the `carid` parameter.  A valid UK registered car Vehicle Registration Mark (Car Registration Number).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| space     | String  | Optional       | boot              | <p>Select which boot measurements to use. You can use the <a href="../car-queries#get-car-details"><code>getCar</code></a> query to determine which measurements are available.  Where possible, the API will substitute if measurements are unavailable.  This will be advised in the <code>response->message</code> and <code>results->error\_message</code> <br> <strong>Options:</strong><br><code>boot</code> - core boot measurements from boot floor to parcel shelf/top of rear seats<br><code>lower</code> - use the are below the boot floor.  Where this measurement is used, the boot floor is removable.  Please note that the width and depth of the lower area are used which frequently give a smaller usable area despite the height increasing.<br><code>ceiling</code> - uses the core boot measurements but assumes the parcel-shelf is removed and the space up the boot ceiling is usable.<br><code>max\_height</code> - combines the height of the lower boot and ceiling.  As with the lower measurement, the width and depth of the lower area are also used which frequently gives a smaller usable area despite the height increase.<br><code>seats\_flat</code> - assumes the rear seats are folded flat<br><code>3rdboot</code> - if a 3rd row of seats is available, this value specifies to use the space behind the 3rd row to the height of the seats / parcel-shelf.<br><code>3rdceiling</code> - as with 3rd boot but extends to the height of the ceiling behind the 3rd row of seats.</p> |
| brand     | String  | Optional       | None              | The name of a buggy brand.  If specified, the query will only return results for this brand.  A list of buggy brands can be obtained from [`Get Buggy Brands`](#get-all-buggy-brands)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| sort      | String  | Optional       | brandASC,modelASC | Specify the sort order to return.  You can specify one or both of brand or model e.g `brandASC,modelDESC` or in the singular `modelASC` (or any combination of these).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| variants  | Integer | Optional       | 0                 | Specify whether to return all Buggy Model variants e.g. return the black, red, green, yellow models instead of just returning the one model.  Useful if you want to do price comparisons of all versions available, but generally speaking omitting this is all that would be needed. Use `1` to include, use `0` to exclude.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| shrink    | Integer | Optional       | 0                 | Specify whether to use standard folded measurements or whether to use the smallest possible measurements (e.g remove wheels or handles).  Note - if the manufacturer hasn't advised of removable components, the standard measurements will be used.  Use `1` to use the smallest buggy dimensions, use `0` to use standard.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| double    | Integer | Optional       | 2                 | Specify where to return single occupancy buggy's only (`0`), double buggy's only (`1`) or all types (`2`).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| available | String  | Optional       | prices            | Specify whether to return models where My Buggy My Car has found UK retailers currently selling each model.  Use `prices`to only show models that have a price.  Use `all` to return all models regardless of availability.  Note, this option is available regardless of whether your subscription plan offers pricing information.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% hint style="info" %}
**Counts against quota**: Yes (if the car is measured)
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api.mybuggymycar.com/api/search.php?s=searchbycar&vrm=<VRM>brand=<OPTIONAL>&variants=<OPTIONAL>&double=<OPTIONAL>&shrink=<OPTIONAL>&space=<OPTIONAL>&sort=<OPTIONAL>&available=<OPTIONAL>' \
--header 'Authorization: Basic YOUR_BASE64KEY'

# alternatively replace vrm=<VRM> with carid=<CARID> to search by Car ID Number
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();

$request->setUrl('https://api.mybuggymycar.com/api/search.php?s=searchbycar&vrm=<VRM>brand=<OPTIONAL>&variants=<OPTIONAL>&double=<OPTIONAL>&shrink=<OPTIONAL>&space=<OPTIONAL>&sort=<OPTIONAL>&available=<OPTIONAL>');

// alternatively replace vrm=<VRM> with carid=<CARID> to search by Car ID Number

$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic YOUR_BASE64_KEY'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.mybuggymycar.com")
payload = ''
headers = {
  'Authorization': 'Basic YOUR_BASE64_KEY'
}
conn.request("GET", "/api/search.php?s=searchbycar&vrm=<VRM>brand=<OPTIONAL>&variants=<OPTIONAL>&double=<OPTIONAL>&shrink=<OPTIONAL>&space=<OPTIONAL>&sort=<OPTIONAL>&available=<OPTIONAL>", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))

# alternatively replace vrm=<VRM> with carid=<CARID> to search by Car ID Number
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.mybuggymycar.com/api/search.php?s=searchbycar&vrm=<VRM>brand=<OPTIONAL>&variants=<OPTIONAL>&double=<OPTIONAL>&shrink=<OPTIONAL>&space=<OPTIONAL>&sort=<OPTIONAL>&available=<OPTIONAL>");
xhr.setRequestHeader("Authorization", "Basic YOUR_BASE64_KEY");

xhr.send();

// alternatively replace vrm=<VRM> with carid=<CARID> to search by Car ID Number
```

{% endtab %}
{% endtabs %}

> `[VRM]` can be replaced with a valid `[CARID]` that can be obtained by using the [Car ID Lookup](https://docs.api.mybuggymycar.com/car-queries#carid-lookups) queries. Note, if both are supplied, vrm will be taken in preference. `YOUR_BASE64_KEY` needs to be replaced with your API key.
>
> The above command returns JSON structured like this:

```javascript
{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR NAME",
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",         
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "209"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "car_searched": {
            "carID": "2",
            "vrm": "",
            "manufacturer": "ABARTH",
            "model": "500",
            "body_type": "Hatchback",
            "detailed_model_name": "1.4 16V T-Jet 140 3dr Auto",
            "years": "2012 - 2015",
            "boot_measurement_available": "Yes",
            "lower_boot_measurements_available": "No",
            "third_row_measurements_available": "No",
            "measurements_requested": "boot"
        },
        "buggy_searched": {
            "buggy_brand_filter": "Baby Jogger",
            "show_buggy_variants": "Yes",
            "buggy_occupancy": "All Buggy's",
            "buggy_dimensions": "Standard measurements",
            "buggy_availability": "All"
        }
    },
    "results": [
        {
            "brand_id": "2",
            "brand_name": "Baby Jogger",
            "buggy_model_id": "16",
            "buggy_model_name": "Summit X3",
            "buggy_variant_name": "Black/Grey",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "12.70",
            "buggy_max_weight_kg": "0.00",
            "buggy_suitability": "",
            "buggy_folded_dimensions": "85.00 x 67.50 x 35.50",
            "folded_length": "85.00",
            "folded_depth": "67.50",
            "folded_height": "35.50",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/baby-jogger/16-baby-jogger-Summit_X3--black...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/baby-jogger/16-baby-jogger-Summit_X3--black..."
            }
        },
        {
            "brand_id": "2",
            "brand_name": "Baby Jogger",
            "buggy_model_id": "685",
            "buggy_model_name": "City Tour LUX",
            "buggy_variant_name": "Granite",
            "buggy_variant_colour": "Grey",
            "buggy_model_isdouble": "No",
            "buggy_weight_kg": "9.00",
            "buggy_max_weight_kg": "0.00",
            "buggy_suitability": "",
            "buggy_folded_dimensions": "67.50 x 53.50 x 22.00",
            "folded_length": "67.50",
            "folded_depth": "53.50",
            "folded_height": "22.00",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/baby-jogger/685-baby-jogger-City_Tour_LUX--grey...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/baby-jogger/685-baby-jogger-City_Tour_LUX--grey..."
            }
        },
        {
            "brand_id": "2",
            "brand_name": "Baby Jogger",
            "buggy_model_id": "5053",
            "buggy_model_name": "City Tour 2 Double ",
            "buggy_variant_name": "Jet",
            "buggy_variant_colour": "Black",
            "buggy_model_isdouble": "Yes",
            "buggy_weight_kg": "10.50",
            "buggy_max_weight_kg": "0.00",
            "buggy_suitability": "From Birth",
            "buggy_folded_dimensions": "66.50 x 63.00 x 25.00",
            "folded_length": "66.50",
            "folded_depth": "63.00",
            "folded_height": "25.00",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/baby-jogger/5053-baby-jogger-City_Tour_2_Double_--black...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/baby-jogger/5053-baby-jogger-City_Tour_2_Double_--black..."
            }
        }
    ]
}
```

### Will A Buggy Fit in a Car Boot?

Compares the specified car and buggy to determine if the buggy will fit into the boot of the car.

The returned json includes confirmation of both the car and the buggy that was specified in the request.

The `results` array will detail a simple Yes/No response to "will the buggy fit". It also details 4 positions that the buggy might or might not fit.

In the event the `results` array returns "N/A", this likely indicates that the necessary boot measurements have not been collected yet. Check the `boot_measurement_available` value from the `search` array. A "Yes" confirms that this car can be used to use the buggy comparison APIs

**Note**, the `carid` must be identified using the [Car ID Lookup](https://docs.api.mybuggymycar.com/car-queries#carid-lookups) searches. Alternatively, you could use the `vrm`  parameter which will perform this lookup.

#### HTTP Request

`https://api.mybuggymycar.com/api/search.php?s=buggyfit&carid=<CARID>&buggyid=<BUGGYID>&space=<OPTIONAL>&shrink=<OPTIONAL>` \
\
**OR** \
\
&#x20;`https://api.mybuggymycar.com/api/car/buggyFit.php?vrm=<VRM>&buggyid=<BUGGYID>`

Note: `buggyid` can be substituted by buggy `brand`, `model` and `variant`

#### URL Parameters

| Parameter | Type    | Required?          | Default | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        |
| --------- | ------- | ------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| carid     | Integer | Yes (or VRM)       | N/A     | A valid `carid`.  The `carid` corresponds to a car id that can be identified using the [Car ID Lookup](https://docs.api.mybuggymycar.com/car-queries#carid-lookups) searches.  Alternatively, use the `vrm` parameter                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| vrm       | String  | Yes (or carid)     | N/A     | An alternative to the `carid` parameter.  A valid UK registered car Vehicle Registration Mark (Car Registration Number).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| buggyid   | Integer | Yes                | N/A     | A valid Buggy Model ID. Use [`getModels`](#get-buggy-models) to identify a valid buggy ID                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| brand     | String  | Yes (alternate)    | N/A     | URL encoded brand name as defined in [`getBuggyBrand`](#get-all-buggy-brands)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| model     | String  | Yes (with `brand`) | N/A     | URL encoded model name as defined in [`getBuggyModelsList`](#get-buggy-models-list)or[`getBuggyModels`](#get-buggy-models)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| variant   | String  | Yes (with `brand`) | N/A     | URL encoded variant name as defined in either [`getBuggyModelsList`](#get-buggy-models-list)or[`getBuggyModels`](#get-buggy-models) or [`getvariants`](#get-buggy-model-variants)                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
| space     | String  | Optional           | boot    | <p>Select which boot measurements to use. You can use the <code>getCar</code> query to determine which measurements are available.  Where possible, the API will substitute if measurements are unavailable.  This will be advised in the <code>response->message</code> and <code>results->error\_message</code> <br> <strong>Options:</strong><br><code>boot</code> - core boot measurements from boot floor to parcel shelf/top of rear seats<br><code>lower</code> - use the are below the boot floor.  Where this measurement is used, the boot floor is removable.  Please note that the width and depth of the lower area are used which frequently give a smaller usable area despite the height increasing.<br><code>ceiling</code> - uses the core boot measurements but assumes the parcel-shelf is removed and the space up the boot ceiling is usable.<br><code>max\_height</code> - combines the height of the lower boot and ceiling.  As with the lower measurement, the width and depth of the lower area are also used which frequently gives a smaller usable area despite the height increase.<br><code>seats\_flat</code> - assumes the rear seats are folded flat<br><code>3rdboot</code> - if a 3rd row of seats are available, this value specifies to use the space behind the 3rd row to the height of the seats / parcel-shelf.<br><code>3rdceiling</code> - as with 3rd boot but extends to the height of the ceiling behind the 3rd row of seats.</p> |
| shrink    | Integer | Optional           | 0       | Specify whether to use standard folded measurements or whether to use the smallest possible measurements (e.g remove wheels or handles).  Note - if the manufacturer hasn't advised of removable components, the standard measurements will be used.  Use `1` to use smallest buggy dimensions, use `0` to use standard.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |

{% hint style="info" %}
**Counts against quota**: Yes (if car is measured)
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api.mybuggymycar.com/api/search.php?s=buggyfit&carid=<CARID>&buggyid=<BUGGYID>&shrink=<OPTIONAL>&space=<OPTIONAL>' \
--header 'Authorization: Basic YOUR_BASE64_KEY'

# alternatively replace carid=<CARID> with vrm=<VRM> to search by Car Registration Number
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();

$request->setUrl('https://api.mybuggymycar.com/api/search.php?s=buggyfit&carid=<CARID>&buggyid=<BUGGYID>&shrink=<OPTIONAL>&space=<OPTIONAL>');

// alternatively replace carid=<CARID> with vrm=<VRM> to search by Car Registration Number

$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic YOUR_BASE64_KEY'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.mybuggymycar.com")
payload = ''
headers = {
  'Authorization': 'Basic YOUR_BASE64_KEY'
}
conn.request("GET", "/api/search.php?s=buggyfit&carid=<CARID>&buggyid=<BUGGYID>&shrink=<OPTIONAL>&space=<OPTIONAL>", payload, headers)
res = conn.getresponse()
data = res.read()
)p
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.mybuggymycar.com/api/search.php?s=buggyfit&carid=<CARID>&buggyid=<BUGGYID>&shrink=<OPTIONAL>&space=<OPTIONAL>");
xhr.setRequestHeader("Authorization", "Basic YOUR_BASE64_KEY");

xhr.send();

// alternatively replace carid=<CARID> with vrm=<VRM> to search by Car Registration Number
```

{% endtab %}
{% endtabs %}

> `[VRM]` can be replaced with a valid `[CARID]` that can be obtained by using the [Car ID Lookup](https://docs.api.mybuggymycar.com/broken-reference) queries. Note, if both are supplied, vrm will be taken in preference. `YOUR_BASE64_KEY` needs to be replaced with your API key.
>
> The above command returns JSON structured like this:

```javascript
{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR NAME",
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",         
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "209"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "car_searched": {
            "carID": "",
            "vrm": "XXXXXX",
            "manufacturer": "BMW",
            "model": "X3",
            "body_type": "Station Wagon",
            "detailed_model_name": "xDrive30d M Sport Auto",
            "years": "2018 - 2018",
            "boot_measurement_available": "Yes",
            "lower_boot_measurements_available": "No",
            "third_row_measurements_available": "No",
            "measurements_requested": "ceiling"
        },
        "buggy_searched": {
            "brand_id": "6",
            "brand_name": "Britax",
            "buggy_model_id": "38",
            "buggy_model_name": "B-Agile 3",
            "buggy_variant_name": "Cosmic Black",
            "buggy_folded_dimensions": "71.00 x 58.00 x 30.00",
            "buggy_dimensions": "Standard measurements",
            "buggy_availability": "With Prices",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/britax/38-britax-B-Agile_3--black...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/britax/38-britax-B-Agile_3--black..."
            }
        }
    },
    "results": [
        {
            "willItFit": "Yes",
            "fitLayingDownLR": "Yes",
            "fitLayingDownFB": "Yes",
            "fitLayingDownOnSide": "Yes",
            "fitLayingDownOnEnd": "Yes",
            "error_message": "The search was successful"
        }
    ]
}
```

### Will A Buggy Fit In A Space?

This call might be helpful if you want to see whether a buggy will fit into space in your home (a cupboard under the stairs for example), or if you want to check if your buggy is allowed as carry-on when travelling on a plane.

The call compares the folded dimensions of the specified buggy to the dimensions you specify, to determine if the buggy will fit into that space.

The returned json includes confirmation of both the buggy and the dimensions that were specified in the request.

The `results` array will detail a simple Yes/No response to "will the buggy fit". It also details 4 positions that the buggy might or might not fit.

#### HTTP Request

`https://api.mybuggymycar.com/api/search.php?s=buggyfitother&buggyid=<BUGGYID>&shrink=<SHRINK>&width=<WIDTH>&height=<HEIGHT>&depth=<DEPTH>`

#### OR

`https://api.mybuggymycar.com/api/search.php?s=buggyfitother&brand=<BRAND>&model=<MODEL>&variant=<VARIANT>&shrink=<SHRINK>&width=<WIDTH>&height=<HEIGHT>&depth=<DEPTH>`

#### URL Parameters

| Parameter | Type    | Required?          | Default | Description                                                                                                                                                                                                                                                                                                                  |
| --------- | ------- | ------------------ | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| buggyid   | Integer | Yes                | N/A     | A valid Buggy Model ID.  Use [`getBuggyModelsList`](#get-buggy-models-list)  [`getBuggyModels`](#get-buggy-models) to identify a valid ID                                                                                                                                                                                    |
| brand     | String  | Yes (alternate)    | N/A     | URL encoded brand name as defined in [`getBuggyBrand`](#get-all-buggy-brands)                                                                                                                                                                                                                                                |
| model     | String  | Yes (with `brand`) | N/A     | URL encoded model name as defined in [`getBuggyModelsList`](#get-buggy-models-list)or[`getBuggyModels`](#get-buggy-models)                                                                                                                                                                                                   |
| variant   | String  | Yes (with `brand`) | N/A     | URL encoded variant name as defined in either [`getBuggyModelsList`](#get-buggy-models-list)or[`getBuggyModels`](#get-buggy-models) or [`getvariants`](#get-buggy-model-variants)                                                                                                                                            |
| shrink    | Integer | Optional           | 0       | Specify whether to use standard folded measurements or whether to use the smallest possible measurements (e.g remove wheels or handles).  Note - if the manufacturer hasn't advised of removable components, the standard measurements will be used.  Use `1` to use the smallest buggy dimensions, use `0` to use standard. |
| width     | Integer | Yes                | N/A     | Specify the width in cm of the space you want the buggy to fit in to                                                                                                                                                                                                                                                         |
| height    | Integer | Yes                | N/A     | Specify the height in cm of the space you want the buggy to fit in to                                                                                                                                                                                                                                                        |
| depth     | Integer | Yes                | N/A     | Specify the depth in cm of the space you want the buggy to fit in to                                                                                                                                                                                                                                                         |

{% hint style="info" %}
**Counts against quota**: Yes (if car is measured)
{% endhint %}

{% tabs %}
{% tab title="cURL" %}

```bash
curl --location --request GET 'https://api.mybuggymycar.com/api/search.php?s=buggyfitotherbuggyid&<BUGGYID>&shrink=<SHRINK>&width=<WIDTH>&height=<HEIGHT>&depth=<DEPTH>' \
--header 'Authorization: Basic YOUR_BASE64_KEY'
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();

$request->setUrl('https://api.mybuggymycar.com/api/search.php?s=buggyfitotherbuggyid&<BUGGYID>&shrink=<SHRINK>&width=<WIDTH>&height=<HEIGHT>&depth=<DEPTH>');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Authorization' => 'Basic YOUR_BASE64_KEY'
));
try {
  $response = $request->send();
  if ($response->getStatus() == 200) {
    echo $response->getBody();
  }
  else {
    echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
    $response->getReasonPhrase();
  }
}
catch(HTTP_Request2_Exception $e) {
  echo 'Error: ' . $e->getMessage();
}
```

{% endtab %}

{% tab title="Python" %}

```python
import http.client

conn = http.client.HTTPSConnection("api.mybuggymycar.com")
payload = ''
headers = {
  'Authorization': 'Basic YOUR_BASE64_KEY'
}
conn.request("GET", "/api/search.php?s=buggyfitotherbuggyid&<BUGGYID>&shrink=<SHRINK>&width=<WIDTH>&height=<HEIGHT>&depth=<DEPTH>", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
```

{% endtab %}

{% tab title="Javascript" %}

```javascript
var xhr = new XMLHttpRequest();
xhr.withCredentials = true;

xhr.addEventListener("readystatechange", function() {
  if(this.readyState === 4) {
    console.log(this.responseText);
  }
});

xhr.open("GET", "https://api.mybuggymycar.com/api/search.php?s=buggyfitotherbuggyid&<BUGGYID>&shrink=<SHRINK>&width=<WIDTH>&height=<HEIGHT>&depth=<DEPTH>");
xhr.setRequestHeader("Authorization", "Basic YOUR_BASE64_KEY");

xhr.send();
```

{% endtab %}
{% endtabs %}

> Make sure to replace `<WIDTH>`, `<HEIGHT>` and `<DEPTH>` with a positive value in cm, `BUGGYID` with a valid Buggy Model ID and `YOUR_BASE64_KEY` with your API key.
>
> The above command returns JSON structured like this:

```javascript
{
    "account": {
        "subscriber": "YOUR_SUBSCRIPTON_KEY",
        "name": "YOUR_NAME",
        "subscription_active": "1",
        "subscription_plan_name": "Executive",
        "subscription_renewal_date": "15-01-2021",         
        "no_api_calls_allowed": 2000,
        "no_api_calls_used": "232"
    },
    "response": {
        "code": "200",
        "code_description": "Ok",
        "message": "Query successful"
    },
    "search": {
        "buggy_searched": {
            "brand_id": "35",
            "brand_name": "Phil and Teds",
            "buggy_model_id": "557",
            "buggy_model_name": "mod",
            "buggy_variant_name": "Capri",
            "buggy_folded_dimensions": "71.00 x 57.00 x 32.00",
            "buggy_dimensions": "Standard measurements",
            "buggy_availability": "With Prices",
            "images": {
                "buggy_image_url": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcdefault450/brands/phil-and-teds/557-phil-and-teds-mod--green...",
                "buggy_thumbnail": "https://ik.imagekit.io/mybuggymycar/buggy-images/tr:n-mbmcthumbnail/brands/phil-and-teds/557-phil-and-teds-mod--green..."
            }
        },
        "dimensions_checked": {
            "width": "100",
            "height": "100",
            "depth": "50"
        }
    },
    "results": [
        {
            "willItFit": "Yes",
            "fitLayingDownLR": "No",
            "fitLayingDownFB": "No",
            "fitLayingDownOnSide": "Yes",
            "fitLayingDownOnEnd": "Yes",
            "error_message": "The comparison was successful"
        }
    ]
}
```
