> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.repliers.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# Optimizing API Requests with the "fields" Parameter


### Introduction

In our API, the GET /listings endpoint allows you to retrieve property listings. To optimize your API requests and improve performance, we offer the fields parameter. This parameter enables you to specify only the fields you need in the response, making your API calls more efficient.

### Why Use the "fields" Parameter?

Requesting only the necessary fields in your API responses is a best practice because:

* Speeds Up Responses: Smaller response payloads reduce the time it takes for data to be transferred from our servers to your application.
* Reduces Bandwidth Usage: By limiting the amount of data being sent, you conserve bandwidth, which is especially important for mobile applications or environments with limited connectivity.
* Improves Performance: Fewer fields mean less data processing on your end, leading to faster and more efficient applications.

### How to Use the "fields" Parameter

To use the fields parameter, simply add it to your GET /listings request URL and specify the fields you want to include in the response. The fields should be comma-separated.

###### Example

If you only need the MLS® number and list price of the listings, your request would look like this:

`GET /listings?fields=mlsNumber,listPrice`

###### Sample Response

Here’s an example of what the response might look like when you specify mlsNumber and listPrice:

```json
{
    "listings": [
        {
            "mlsNumber": "123456",
            "listPrice": 500000
        },
        {
            "mlsNumber": "654321",
            "listPrice": 750000
        }
    ]
}
```

As you can see, only the mlsNumber and listPrice fields are included in the response, making the payload smaller and the response faster.

### Best Practices

* Only Request What You Need: Carefully consider which fields are essential for your application and request only those.
* Test and Optimize: Test different combinations of fields to see how they impact the performance of your application.

### Conclusion

Using the fields parameter is a simple yet powerful way to optimize your API requests. By requesting only the necessary fields, you can significantly improve the performance of your application, reduce bandwidth usage, and ensure a smoother user experience.

# What questions does this article answer?

* What is the `fields` parameter in the `GET /listings` endpoint?  
* How does the `fields` parameter improve performance and reduce bandwidth?  
* How do I specify which fields to include in the response?  
* What does a typical request and response look like when using `fields`?  
* What are best practices for deciding which fields to request?  