External Two squares, one overlapping the bottom one. Top square has an arrow pointing away, as if leading you away

Market Basket

The Market Basket API lets you request and download Market Basket exports for your agency without using the Market Basket application. An export is a set of personal lines rate-quote data for one state, rate source, and line of business over a date range, delivered as a zip file of CSV files.

Use it to:

Exports are generated in the background. Creating an export returns its ID right away; the file is ready once its status is COMPLETE.

Authentication

The Market Basket API uses the Authorization Code flow (User-based OAuth 2.0), so calls are made on behalf of a signed-in Zywave user. Register an app, request the scopes below, and send the access token as Authorization: Bearer <access_token>.

Scopes

Scope Allows
api.marketBasket Create exports, and search, check status, and download them
api.marketBasket:read Search, check status, and download only. Creating an export returns 403.

Request at least one of them when you register your app. Use api.marketBasket:read if your app only needs to read and download exports.

Endpoint api.marketBasket api.marketBasket:read
POST …/exports Yes No (403)
GET …/exports/search Yes Yes
GET …/exports/{exportId}/status Yes Yes
GET …/exports/{exportId}/download-url Yes Yes

Organization and agency

Every path includes the organization and agency, /org/{orgId}/agency/{agencyId}/. The signed-in user must have a profile for that agency, or the call returns 403.

Path parameter Type Description
orgId GUID Your organization ID. Must match the signed-in user's organization.
agencyId integer Your agency ID. The signed-in user must have a profile for this agency.
exportId GUID The export ID returned when the export was created

Endpoints

All paths start with /v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket. Full request and response schemas are in the specification below.

Method Path Description
POST /exports Create exports (one per state, rate source, and line of business combination)
GET /exports/search Search and list the agency's exports, with paging, sorting and filters
GET /exports/{exportId}/status Status of a single export
GET /exports/{exportId}/download-url Presigned download link for a completed export
  • export_date must be today's date in UTC, or the request returns 400.
  • The date range can be at most 31 days, and start_date must be on or before end_date.
  • States are two-letter codes, such as TX.
  • Requesting a download link before the export is COMPLETE returns 409 with the error REPORT_NOT_READY. Check the status first.
  • Large exports, such as a full month for a large state, can take several minutes to generate.
  • Field names in requests and responses are snake_case, except requestId, exportId and submittedAt.

Typical workflow

1. Create an export

curl --request POST \
  --url https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports \
  --header 'Authorization: Bearer {access_token}' \
  --header 'Content-Type: application/json' \
  --data '{
    "export_type": "MARKETBASKET",
    "date_range": { "type": "CUSTOM", "start_date": "2026-10-06", "end_date": "2026-10-12" },
    "rate_sources": ["TR"],
    "export_rates_for": "CHOSEN_TIME_PERIOD",
    "include_zero_premium": false,
    "states": ["TX"],
    "lob": ["AUTO"],
    "file_format": "CSV",
    "delivery_method": "DOWNLOAD",
    "notify_email": false,
    "frequency": "ONCE",
    "export_date": "2026-10-13"
  }'

{
  "requestId": "edc72f6a-4904-4b14-b9e1-e2bfb452b9a4",
  "requested_at": "2026-10-13T14:05:12Z",
  "exports": [
    {
      "exportId": "c6ef488b-e12f-4d00-8d3b-979b91c06606",
      "state": "TX",
      "rate_source": "TR",
      "lob": "AUTO",
      "date_range": {
        "start_date": "2026-10-06",
        "end_date": "2026-10-12"
      },
      "export_date": "2026-10-13",
      "status": "PENDING"
    }
  ]
}
using System.Net.Http;
using System.Net.Http.Headers;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, "https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports");

request.Headers.Add("Authorization", "Bearer {access_token}");

request.Content = new StringContent("{\n    \"export_type\": \"MARKETBASKET\",\n    \"date_range\": { \"type\": \"CUSTOM\", \"start_date\": \"2026-10-06\", \"end_date\": \"2026-10-12\" },\n    \"rate_sources\": [\"TR\"],\n    \"export_rates_for\": \"CHOSEN_TIME_PERIOD\",\n    \"include_zero_premium\": false,\n    \"states\": [\"TX\"],\n    \"lob\": [\"AUTO\"],\n    \"file_format\": \"CSV\",\n    \"delivery_method\": \"DOWNLOAD\",\n    \"notify_email\": false,\n    \"frequency\": \"ONCE\",\n    \"export_date\": \"2026-10-13\"\n  }");
request.Content.Headers.ContentType = new MediaTypeHeaderValue("application/json");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpRequest.BodyPublishers;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports"))
    .POST(BodyPublishers.ofString("{\n    \"export_type\": \"MARKETBASKET\",\n    \"date_range\": { \"type\": \"CUSTOM\", \"start_date\": \"2026-10-06\", \"end_date\": \"2026-10-12\" },\n    \"rate_sources\": [\"TR\"],\n    \"export_rates_for\": \"CHOSEN_TIME_PERIOD\",\n    \"include_zero_premium\": false,\n    \"states\": [\"TX\"],\n    \"lob\": [\"AUTO\"],\n    \"file_format\": \"CSV\",\n    \"delivery_method\": \"DOWNLOAD\",\n    \"notify_email\": false,\n    \"frequency\": \"ONCE\",\n    \"export_date\": \"2026-10-13\"\n  }"))
    .setHeader("Authorization", "Bearer {access_token}")
    .setHeader("Content-Type", "application/json")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
fetch('https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports', {
  method: 'POST',
  headers: {
    'Authorization': 'Bearer {access_token}',
    'Content-Type': 'application/json'
  },
  // body: '{\n    "export_type": "MARKETBASKET",\n    "date_range": { "type": "CUSTOM", "start_date": "2026-10-06", "end_date": "2026-10-12" },\n    "rate_sources": ["TR"],\n    "export_rates_for": "CHOSEN_TIME_PERIOD",\n    "include_zero_premium": false,\n    "states": ["TX"],\n    "lob": ["AUTO"],\n    "file_format": "CSV",\n    "delivery_method": "DOWNLOAD",\n    "notify_email": false,\n    "frequency": "ONCE",\n    "export_date": "2026-10-13"\n  }',
  body: JSON.stringify({
    'export_type': 'MARKETBASKET',
    'date_range': {
      'type': 'CUSTOM',
      'start_date': '2026-10-06',
      'end_date': '2026-10-12'
    },
    'rate_sources': [
      'TR'
    ],
    'export_rates_for': 'CHOSEN_TIME_PERIOD',
    'include_zero_premium': false,
    'states': [
      'TX'
    ],
    'lob': [
      'AUTO'
    ],
    'file_format': 'CSV',
    'delivery_method': 'DOWNLOAD',
    'notify_email': false,
    'frequency': 'ONCE',
    'export_date': '2026-10-13'
  })
});
import requests

headers = {
    'Authorization': 'Bearer {access_token}',
    'Content-Type': 'application/json',
}

json_data = {
    'export_type': 'MARKETBASKET',
    'date_range': {
        'type': 'CUSTOM',
        'start_date': '2026-10-06',
        'end_date': '2026-10-12',
    },
    'rate_sources': [
        'TR',
    ],
    'export_rates_for': 'CHOSEN_TIME_PERIOD',
    'include_zero_premium': False,
    'states': [
        'TX',
    ],
    'lob': [
        'AUTO',
    ],
    'file_format': 'CSV',
    'delivery_method': 'DOWNLOAD',
    'notify_email': False,
    'frequency': 'ONCE',
    'export_date': '2026-10-13',
}

response = requests.post(
    'https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports',
    headers=headers,
    json=json_data,
)

# Note: json_data will not be serialized by requests
# exactly as it was in the original request.
#data = '{\n    "export_type": "MARKETBASKET",\n    "date_range": { "type": "CUSTOM", "start_date": "2026-10-06", "end_date": "2026-10-12" },\n    "rate_sources": ["TR"],\n    "export_rates_for": "CHOSEN_TIME_PERIOD",\n    "include_zero_premium": false,\n    "states": ["TX"],\n    "lob": ["AUTO"],\n    "file_format": "CSV",\n    "delivery_method": "DOWNLOAD",\n    "notify_email": false,\n    "frequency": "ONCE",\n    "export_date": "2026-10-13"\n  }'
#response = requests.post(
#    'https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports',
#    headers=headers,
#    data=data,
#)

The response is 202 Accepted and lists one export per state, rate source, and line of business combination.

Request body fields:

Field Required Values
export_type Yes MARKETBASKET, CARRIER, BENEFITS_CARRIERS
date_range.type Yes CUSTOM
date_range.start_date, date_range.end_date Yes YYYY-MM-DD; start on or before end, at most 31 days apart
rate_sources Yes One or more of RATEAPI, TR (TurboRater), TFW (TurboRater for Websites)
states Yes One or more two-letter state codes, such as TX
lob Yes One or more of AUTO, HOME
file_format Yes CSV, CSV_WITH_QUOTES, PARQUET
frequency Yes ONCE
export_date Yes Today's date in UTC (YYYY-MM-DD)
export_rates_for No CHOSEN_TIME_PERIOD (default) or LATEST_ITERATION
include_zero_premium No true / false (default false)
delivery_method No DOWNLOAD (default)
notify_email No true to email the requester when the export is ready (default false)

2. Check the status

curl --request GET \
  --url https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/status \
  --header 'Authorization: Bearer {access_token}'

{
  "exportId": "c6ef488b-e12f-4d00-8d3b-979b91c06606",
  "status": "COMPLETE",
  "submittedAt": "2026-10-13T14:05:12Z"
}
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/status");

request.Headers.Add("Authorization", "Bearer {access_token}");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/status"))
    .GET()
    .setHeader("Authorization", "Bearer {access_token}")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
fetch('https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/status', {
  headers: {
    'Authorization': 'Bearer {access_token}'
  }
});
import requests

headers = {
    'Authorization': 'Bearer {access_token}',
}

response = requests.get(
    'https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/status',
    headers=headers,
)

Exports move from PENDING to PROCESSING to COMPLETE, or to FAILED if generation doesn't succeed. Call this until status is COMPLETE.

3. Download the export

curl --request GET \
  --url https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/download-url \
  --header 'Authorization: Bearer {access_token}'

{
  "exportId": "c6ef488b-e12f-4d00-8d3b-979b91c06606",
  "presigned_url": "https://example.com/MBExport_TR_Auto_TX.zip?signature=...",
  "expires_at": "2026-10-13T14:30:00Z"
}
using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/download-url");

request.Headers.Add("Authorization", "Bearer {access_token}");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/download-url"))
    .GET()
    .setHeader("Authorization", "Bearer {access_token}")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
fetch('https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/download-url', {
  headers: {
    'Authorization': 'Bearer {access_token}'
  }
});
import requests

headers = {
    'Authorization': 'Bearer {access_token}',
}

response = requests.get(
    'https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/{exportId}/download-url',
    headers=headers,
)

Download the zip from presigned_url. The link is valid for 15 minutes; request a new one if it expires.

Searching exports

curl --request GET \
  --url 'https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/search?status=COMPLETE&state=TX&page=1&page_size=25' \
  --header 'Authorization: Bearer {access_token}'

using System.Net.Http;

HttpClient client = new HttpClient();

HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, "https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/search?status=COMPLETE&state=TX&page=1&page_size=25");

request.Headers.Add("Authorization", "Bearer {access_token}");

HttpResponseMessage response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
string responseBody = await response.Content.ReadAsStringAsync();
import java.io.IOException;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

HttpClient client = HttpClient.newHttpClient();

HttpRequest request = HttpRequest.newBuilder()
    .uri(URI.create("https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/search?status=COMPLETE&state=TX&page=1&page_size=25"))
    .GET()
    .setHeader("Authorization", "Bearer {access_token}")
    .build();

HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
fetch('https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/search?status=COMPLETE&state=TX&page=1&page_size=25', {
  headers: {
    'Authorization': 'Bearer {access_token}'
  }
});
import requests

headers = {
    'Authorization': 'Bearer {access_token}',
}

params = {
    'status': 'COMPLETE',
    'state': 'TX',
    'page': '1',
    'page_size': '25',
}

response = requests.get(
    'https://api.zywave.com/v3/quoting/personalLines/v1/org/{orgId}/agency/{agencyId}/marketBasket/exports/search',
    params=params,
    headers=headers,
)
Query parameter Description
terms Free-text search
show_expired Include expired exports (default false)
export_type, status, rate_source, state, lob Filters; comma-separated or repeated for several values
requested_by Filter by requester
export_date_range_start, export_date_range_end Export date range (YYYY-MM-DD)
sort_by requested_at (default), export_type, status, export_date_range, requested_by, rate_source, state, lob
sort_direction asc or desc (default desc)
page, page_size Paging (defaults 1 and 25)

The response contains data (requests, each with its exports) and pagination (page, page_size, total).

Errors

Errors are returned as problem details (type, title, status, detail).

Status Meaning
400 The request failed validation. The response lists the fields to fix in errors.
401 The access token is missing or expired.
403 The token doesn't have the required scope, or the user has no profile for the agency in the path.
404 The export doesn't exist for this organization and agency.
409 The export isn't ready to download yet. The response includes "error": "REPORT_NOT_READY" and the current exportStatus.

Specification