Skip to main content

Get Records

The Get Records API provides direct access to your database records, allowing you to retrieve all records or filter by timestamp. Results are always returned in descending order by last seen time (most recent first).

GET /v1/databases/{id}/records

Path Parameters

ParameterTypeRequiredDescription
idstringYesThe ID of your Lightfeed database

Query Parameters

ParameterTypeRequiredDescription
start_timestringNoStart of last seen time range (ISO 8601 timestamp)
end_timestringNoEnd of last seen time range (ISO 8601 timestamp)
limitnumberNoMaximum number of records to return (default: 100, max: 500)
cursorstringNoCursor for pagination (from previous response)

Example Requests

All records

Export your entire database by paginating through all records in descending order by last seen time (most recent first).

curl "https://api.lightfeed.ai/v1/databases/your-database-id/records?limit=500" \
-H "x-api-key: your-api-key"

Records Within a Time Range

This example shows how to retrieve records that were seen within a specific time range.

curl "https://api.lightfeed.ai/v1/databases/your-database-id/records?\
start_time=2024-12-01T00:00:00Z&\
end_time=2024-12-31T23:59:59Z&\
limit=100" \
-H "x-api-key: your-api-key"

Recent Records

This example shows how to retrieve records seen in the last 24 hours.

# Calculate timestamp for 24 hours ago
START_TIME=$(date -u -d "24 hours ago" +"%Y-%m-%dT%H:%M:%SZ")

curl "https://api.lightfeed.ai/v1/databases/your-database-id/records?start_time=${START_TIME}" \
-H "x-api-key: your-api-key"

Example Response

{
"results": [
{
"id": 1345,
"data": {
"company_name": "Acme Inc.",
"industry": "Finance",
"website": "https://acme.com",
"employees": 250,
"funding_amount": 5000000,
"is_public": false
},
"timestamps": {
"first_seen_time": "2024-03-15T14:22:13Z",
"last_changed_time": "2024-07-02T09:45:30Z",
"last_seen_time": "2024-10-01T18:30:45Z"
}
}
// Additional results...
],
"pagination": {
"limit": 100,
"next_cursor": "2024-09-01T18:30:45Z_1500",
"has_more": true
}
}

Response Structure

The response contains a list of records and pagination information.

FieldTypeDescription
resultsarrayList of records
paginationobjectInformation for continued querying

Pagination Object

FieldTypeDescription
limitnumberThe requested limit parameter value from the original request
next_cursorstringToken to use for fetching the next page (null if no more results)
has_morebooleanIndicates whether more results are available

Record Object

Each record in the results array has the following structure:

FieldTypeDescription
idnumberUnique identifier for the record
dataobjectThe record's structured data
timestampsobjectTiming information for the record