how to configure a connector to consider the case ...
# replication-ask-ai
m
how to configure a connector to consider the case where when extracting one day of data, the start and end dates must be equal?
k
Configuring Equal Start and End Dates for Single-Day Extraction When your API requires the start and end dates to be equal for a single-day extraction (rather than spanning a range), there are a couple of approaches depending on your connector setup. Option 1: Use is_compare_strictly + step: P1D Set
step: P1D
so each slice covers exactly one day, and use
is_compare_strictly: true
to skip requests where start equals end (if the API rejects them). However, if your API specifically requires start = end for a single day, you'll want to inject the same value for both parameters. Option 2: Inject the Same Value for Both Start and End Disable the standard `start_time_option`/`end_time_option` injection and use custom parameter injection with
stream_interval.start_time
for both fields. This way, both parameters receive the slice's start date:
Copy code
incremental_sync:
  type: DatetimeBasedCursor
  cursor_field: updated_at
  start_datetime: "{{ config['start_date'] }}"
  end_datetime: "{{ now_utc() }}"
  datetime_format: "%Y-%m-%d"
  step: P1D
  cursor_granularity: P1D
Then in your requester's request parameters (using custom injection):
Copy code
requester:
  type: HttpRequester
  # ...
  request_parameters:
    startDate: "{{ stream_interval.start_time }}"
    endDate: "{{ stream_interval.start_time }}"  # same as start
This ensures both
startDate
and
endDate
always receive the same value — the start of the daily slice. [Custom Parameter Injection] Option 3: Day-Align Both Values via Jinja If your datetime format includes a time component but the API needs date-only equality, you can strip the time part:
Copy code
request_parameters:
  startDate: "{{ stream_interval.start_time.split('T')[0] }}"
  endDate: "{{ stream_interval.start_time.split('T')[0] }}"
This pattern is used in production connectors to anchor requests to a calendar day regardless of the raw slice boundary time. [Amazon Seller Partner Fix] Key Settings Summary The
step: P1D
combined with
datetime_format: "%Y-%m-%d"
and injecting
stream_interval.start_time
into both parameters is the most straightforward approach for APIs that require equal start and end dates per day. [DatetimeBasedCursor Docs] 👍 0 button 👎 0 button â„šī¸ Tip: Mention @kapa.ai in the thread for follow-ups or DM the app for 1-to-1 help., with interactive elements