Skip to main content

Searches API

The Searches API allows you to list and retrieve information about your searches.

Authentication Required

All API requests require authentication. See API Reference for details.

List Searches

Get all active searches in a workspace.

GET /api/searches

Query Parameters

ParameterTypeRequiredDescription
workspace_idstringYesThe workspace ID to list searches for

Response

Returns an array of search objects.

[
{
"_id": "507f1f77bcf86cd799439012",
"name": "Tech Industry Leaders",
"query": "CTO OR \"Chief Technology Officer\"",
"frequency": "daily",
"is_activated": true,
"prompt": "Find posts from CTOs in tech companies",
"query_type": "search_keyword",
"query_identifier": null,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"_id": "507f1f77bcf86cd799439013",
"name": "Follow Specific Person",
"query": "https://linkedin.com/in/vearnold",
"frequency": "daily",
"is_activated": true,
"prompt": "Track all posts from this user",
"query_type": "user_profile",
"query_identifier": "vearnold",
"created_at": "2024-01-12T09:00:00Z",
"updated_at": "2024-01-12T09:00:00Z"
},
{
"_id": "507f1f77bcf86cd799439014",
"name": "Company Posts",
"query": "https://linkedin.com/company/example-corp",
"frequency": "daily",
"is_activated": true,
"prompt": "Track all posts from this company",
"query_type": "company_profile",
"query_identifier": "12345678",
"created_at": "2024-01-13T10:00:00Z",
"updated_at": "2024-01-13T10:00:00Z"
}
]

Response Fields

FieldTypeDescription
_idstringUnique search identifier
namestringSearch name
querystringSearch query (varies by query_type)
frequencystringSearch frequency: hourly, daily, weekly
is_activatedbooleanWhether the search is active
promptstringAI prompt used for the search
query_typestringType of query: search_keyword, user_profile, company_profile
query_identifierstring | nullUsername for user_profile, company ID for company_profile, or null for search_keyword
created_atstringISO 8601 timestamp
updated_atstringISO 8601 timestamp

Query Type Examples

The query and query_identifier fields vary based on query_type:

Keyword Search (query_type: "search_keyword"):

  • query: Search terms, e.g., "CTO OR \"Chief Technology Officer\""
  • query_identifier: Always null

User Profile Search (query_type: "user_profile"):

  • query: Profile URL, e.g., "https://linkedin.com/in/vearnold"
  • query_identifier: LinkedIn username, e.g., "vearnold"

Company Profile Search (query_type: "company_profile"):

  • query: Company URL, e.g., "https://linkedin.com/company/example-corp"
  • query_identifier: LinkedIn company ID, e.g., "12345678"

Rate Limiting

  • 30 requests per minute per API key

Example Request

curl -H "X-API-Key: your_api_key_here" \
https://production.viacurrent.com/api/searches?workspace_id=507f1f77bcf86cd799439013

Get detailed information about a specific search.

GET /api/searches/{search_id}

Path Parameters

ParameterTypeDescription
search_idstringThe search ID to retrieve

Query Parameters

ParameterTypeRequiredDescription
workspace_idstringYesThe workspace ID that owns this search

Response

{
"_id": "507f1f77bcf86cd799439012",
"name": "Tech Industry Leaders",
"query": "CTO OR \"Chief Technology Officer\"",
"frequency": "daily",
"is_activated": true,
"prompt": "Find posts from CTOs in tech companies",
"query_type": "search_keyword",
"query_identifier": null,
"created_at": "2024-01-10T08:00:00Z",
"updated_at": "2024-01-15T10:30:00Z"
}

Rate Limiting

  • 60 requests per minute per API key

Example Request

curl -H "X-API-Key: your_api_key_here" \
https://production.viacurrent.com/api/searches/507f1f77bcf86cd799439012?workspace_id=507f1f77bcf86cd799439013

Use Cases

Get search IDs for filtering posts

# 1. List all searches
curl -H "X-API-Key: your_api_key_here" \
https://production.viacurrent.com/api/searches?workspace_id=507f1f77bcf86cd799439013

# 2. Use search IDs to filter posts
curl -H "X-API-Key: your_api_key_here" \
https://production.viacurrent.com/api/posts?workspace_id=507f1f77bcf86cd799439013&search_ids=507f1f77bcf86cd799439012,507f1f77bcf86cd799439015

Monitor search configuration

# Get details of a specific search to check its configuration
curl -H "X-API-Key: your_api_key_here" \
https://production.viacurrent.com/api/searches/507f1f77bcf86cd799439012?workspace_id=507f1f77bcf86cd799439013

Error Responses

400 Bad Request

{
"detail": "Invalid workspace_id format"
}

403 Forbidden

{
"detail": "search_not_in_workspace"
}

404 Not Found

{
"detail": "Search not found"
}

429 Too Many Requests

{
"detail": "Rate limit exceeded"
}

Next Steps

Once you have search IDs, you can: