Before you start
- Get an API keySign up for 100 free credits, no card. Keys start with
gs_live_. - Put it in the environmentEvery example reads it from
GROUNDSOCIAL_API_KEY:export GROUNDSOCIAL_API_KEY=gs_live_… - Set up PHP
php -m | grep curl # the curl extension ships with most PHP builds
Call Search Redfin homes API from PHP
GET /v1/redfin/search. Save this as main.php and run php main.php. It reads the items in homes and prints price.value for each.
<?php
function groundsocial(string $path, array $params = []): array
{
$url = 'https://api.groundsocial.dev' . $path . ($params ? '?' . http_build_query($params) : '');
$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('GROUNDSOCIAL_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 60,
]);
$raw = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
$data = json_decode($raw, true);
if ($status !== 200) {
$e = $data['error'];
throw new RuntimeException($e['code'] . ': ' . ($e['hint'] ?? $e['message']));
}
return $data;
}
$data = groundsocial('/v1/redfin/search', ['location' => '78704']);
foreach ($data['homes'] as $item) {
echo $item['price']['value'] ?? '', PHP_EOL;
}The response
A real Redfin response to this call, recorded from the live API on 27 Nov 2026 and shortened for display: arrays keep their first items and … marks every cut. The recorded page had 100 items in homes. Live calls return current data in the same shape.
{
"homes": [
{
"propertyId": 31203978,
"listingId": 228228624,
"url": "/TX/Austin/1401-Kinney-Ave-78704/home/31203978",
"price": {
"value": 2450000,
"level": 1
},
"beds": 4,
"baths": 3.5,
"sqFt": {
"value": 3363,
"level": 1
},
"city": "Austin",
"state": "TX",
"zip": "78704",
"mlsStatus": "Active",
"uiPropertyType": 1,
"mlsId": {
"label": "MLS#",
"value": "7388941"
},
"showMlsId": false,
"showDatasourceLogo": false,
"hideSalePrice": false,
"hoa": {
"level": 1
},
"isHoaFrequencyKnown": true,
"pricePerSqFt": {
"value": 729,
"level": 1
},
"lotSize": {
"value": 6359,
"level": 1
},
"fullBaths": 3,
"partialBaths": 1,
"location": {
"value": "Templer J W",
"level": 1
},
"stories": 3,
"…": "43 more fields"
},
{
"propertyId": 31176417,
"listingId": 228368721,
"url": "/TX/Austin/2525-S-Lamar-Blvd-78704/unit-302/home/31176417",
"price": {
"value": 475000,
"level": 1
},
"beds": 2,
"baths": 1,
"sqFt": {
"value": 942,
"level": 1
},
"city": "Austin",
"state": "TX",
"zip": "78704",
"mlsStatus": "Coming Soon",
"uiPropertyType": 2,
"mlsId": {
"label": "MLS#",
"value": "2245952178588426409"
},
"showMlsId": false,
"showDatasourceLogo": false,
"hideSalePrice": false,
"hoa": {
"level": 1
},
"isHoaFrequencyKnown": true,
"pricePerSqFt": {
"value": 504,
"level": 1
},
"lotSize": {
"level": 1
},
"location": {
"value": "Low Theodore Heights",
"level": 1
},
"latLong": {
"value": {
"latitude": 30.2459322,
"longitude": -97.7772561
},
"level": 1
},
"streetLine": {
"value": "2525 S Lamar Blvd #302",
"level": 1
},
"unitNumber": {
"value": "#302",
"level": 1
},
"…": "39 more fields"
},
"… 98 more"
],
"region": {
"region_id": 34098,
"region_type": 2
},
"searchMedian": {
"price": 950000,
"sqFt": 1736,
"pricePerSqFt": 588,
"dom": 23,
"beds": 3,
"baths": 2.5
},
"dataSources": []
}Top-level fields
| Field | Type | Description |
|---|---|---|
homes | RedfinHome[] | – |
region | object | null | The Redfin region searched, or null for a map box search. |
searchMedian | object | null | Redfin’s medians for the search: price, sqFt, price per sqFt, beds, baths, DOM. |
dataSources | object[] | The MLSs the listings come from. |
Parameters
| Name | In | Type | Description |
|---|---|---|---|
url | query | string | A Redfin search link. Example: https://www.redfin.com/city/30818/TX/Austin. |
location | query | string | A ZIP code (or a Redfin search link). Example: 78704. |
region_id | query | integer | – |
region_type | query | integer | 1 neighborhood, 2 ZIP code, 5 county, 6 city, 11 school district. |
map_bounds | query | string | A map box, west,south,east,north in degrees. |
status | query | "for_sale" | "sold" | Default for_sale. One of for_sale, sold. |
sold_within_days | query | integer | With status sold: how far back (default 90). |
property_type | query | string | Comma-separated: house, condo, townhouse, multi_family, land, other, manufactured, co_op. Default all. |
sort | query | "recommended" | "newest" | "price_asc" | "price_desc" | "sqft" | Default recommended. One of recommended, newest, price_asc, price_desc, sqft. |
price_min | query | integer | null | Minimum price, USD. |
price_max | query | integer | null | Maximum price, USD. |
beds_min | query | integer | null | – |
beds_max | query | integer | null | – |
baths_min | query | number | null | – |
sqft_min | query | integer | null | Minimum living area, square feet. |
sqft_max | query | integer | null | Maximum living area, square feet. |
limit | query | integer | – |
Errors and retries
Every error is JSON with error.code (stable: branch on it), message, hint (what to do next), docs_url and retryable. A failed call is never charged. Retry only when retryable is true, after the Retry-After header.
try {
$data = groundsocial('/v1/redfin/search', ['location' => '78704']);
} catch (RuntimeException $e) {
// "code: hint", e.g. "target_not_found: ..." (never charged).
fwrite(STDERR, $e->getMessage() . PHP_EOL);
exit(1);
}| Status | Meaning |
|---|---|
200 | Homes in the area. |
400 | Invalid input. Nothing was charged. |
401 | Missing or invalid API key. |
402 | Not enough credits, a spend cap was reached, or payment is required. |
403 | The target is private, or the account is suspended. |
404 | No Redfin property or ZIP code by that id. |
429 | Too many requests. Wait for Retry-After seconds. |
503 | Redfin is temporarily unavailable. Retryable; nothing was charged. |
Every error code and what to do about it.
Pricing
| Cost | |
|---|---|
| Per call | 1 credit per call |
| 1,000 calls | $1.00 on the starter pack, $0.40 at volume |
| No key (MPP or x402) | $0.01 per call |
| Failed call | Refunded, never charged |
Every response has x-credits-charged and x-credits-remaining headers. Credits never expire. Packs and calculator.
From an AI agent (MCP)
The same call is the redfin_search_all tool on the hosted MCP server, so Claude, Cursor or any MCP client can make it without code. Add the server once:
claude mcp add --transport http groundsocial https://api.groundsocial.dev/mcpThen ask for it in words (“Redfin homes for sale or sold in a region or map box, with filters (up to 350)”), or call the tool directly:
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "redfin_search_all",
"arguments": {
"location": "78704"
}
}
}MCP setup for Claude Desktop, Cursor, VS Code and ChatGPT.
Use Redfin search all in a pipeline
Homes for_sale (default, incl. coming soon) or sold (within sold_within_days, default 90) in an area: url (a Redfin search link such as https://www.redfin.com/city/30818/TX/Austin/filter/min-beds=3; its /filter/ part is applied), location (a ZIP code), region_id + region_type, or map_bounds (west,south,east,north).
Keep going
- This call in Python, JavaScript, TypeScript, Go, cURL.
- Search Redfin homes API reference: every field and status code.
- Redfin tutorials and all PHP tutorials.
- Redfin API: every endpoint and price.
- How to get a Redfin property with PHP: One Redfin property: facts, listing, estimate, parcel and walk/transit scores.
Run it on your own data
One key for Redfin and 76 more platforms, over REST or MCP. Free credits on signup, no card.
Redfin is a trademark of its owner. We are not affiliated with or endorsed by it.