### StartupPlatformPostsDataset Example Schema Source: https://docs.predictleads.com/v3 This is an example schema for the StartupPlatformPostsDataset object, illustrating its structure and typical data. ```json { "data": [ { "id": "941340", "type": "startup_platform_post", "attributes": { "published_at": "2024-11-02T19:28:31.000+01:00", "post_type": "show_hn", "post_url": "https://news.ycombinator.com/item?id=42028186", "company_domain": "incrediboxmustard.cc", "company_name": "Incredibox Mustard", "fuzzy_match": false } } ], "meta": { "schema_version": "3.0", "record_state": "active" } } ``` -------------------------------- ### Retrieve Technology Detections using Python http.client Source: https://docs.predictleads.com/v3 This example demonstrates how to retrieve companies using a specific technology with Python's http.client library. It makes a GET request to the technology detections endpoint and prints the response. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/discover/technologies/{technology_id_or_fuzzy_name}/technology_detections", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Successful Job Opening Response Example Source: https://docs.predictleads.com/v3 This is an example of a successful response when retrieving a job opening. It includes the job opening's ID, type, and attributes like title. ```json { "data": [ { "id": "4d5ac23c-5824-427d-96c6-4e8d50a4241a", "type": "job_opening", "attributes": { "title": "AI Engineer", "translated_title": null, "normalized_title": "AI Engineer", ``` -------------------------------- ### MCP Inspector CLI Command Source: https://docs.predictleads.com/v3 Run this command in your terminal to start the MCP Inspector after setting up the `mcp.json` configuration file. Ensure Node.js is installed. ```bash npx -y @modelcontextprotocol/inspector --config mcp.json --server PredictLeads ``` -------------------------------- ### Retrieve Technology Detections using cURL Source: https://docs.predictleads.com/v3 This example shows how to retrieve companies using a specific technology by making a GET request to the technology detections endpoint using cURL. Ensure you replace placeholders with your actual API key and token. ```shell curl --request GET \ --url https://predictleads.com/api/v3/discover/technologies/{technology_id_or_fuzzy_name}/technology_detections \ --header 'X-Api-Key: {your_api_key}' --header 'X-Api-Token: {your_api_token}' ``` -------------------------------- ### ApiSubscription Object Example Source: https://docs.predictleads.com/v3 This JSON object represents an example of the ApiSubscription data, showing a single active subscription with its credit usage. ```json { "data": [ { "id": "ea20b0c1-3427-4004-91e6-59a27be0c9ed", "type": "api_subscription", "attributes": { "status": "active", "monthly_credits_quota": 100, "monthly_credits_used": 42 } } ], "meta": { "schema_version": "3.0" } } ``` -------------------------------- ### Retrieve Latest Startup Platform Posts (Python http.client) Source: https://docs.predictleads.com/v3 This Python script demonstrates how to fetch the latest startup platform posts using the http.client library. It includes setting up the connection, headers, and printing the response. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/discover/startup_platform_posts", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### GET Request Example Source: https://docs.predictleads.com/v3 This snippet shows how to make a GET request to the news_events endpoint using cURL. Ensure you replace placeholders with your actual API key and token. ```Shell curl --request GET \ --url https://predictleads.com/api/v3/discover/news_events \ --header 'X-Api-Key: {your_api_key}' --header 'X-Api-Token: {your_api_token}' ``` -------------------------------- ### Follow Company Request (Python http.client) Source: https://docs.predictleads.com/v3 Python example for following a company using the http.client library. This snippet demonstrates setting headers and making the POST request. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("POST", "/api/v3/companies/{company_id_or_domain}/follow", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Retrieve Latest Startup Platform Posts (cURL) Source: https://docs.predictleads.com/v3 Use this cURL command to make a GET request to the API endpoint for fetching the latest startup platform posts. Ensure you replace placeholders with your actual API key and token. ```shell curl --request GET \ --url https://predictleads.com/api/v3/discover/startup_platform_posts \ --header 'X-Api-Key: {your_api_key}' --header 'X-Api-Token: {your_api_token}' ``` -------------------------------- ### Retrieve Company Job Openings (Python http.client) Source: https://docs.predictleads.com/v3 This Python script demonstrates how to fetch job openings using the http.client library. It sets up the connection, headers, and sends the GET request to the API. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/companies/{company_id_or_domain}/job_openings", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Retrieve Job Openings with Python http.client Source: https://docs.predictleads.com/v3 This Python script demonstrates how to fetch job openings using the http.client library. Replace placeholders with your actual API credentials. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/discover/job_openings", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### News Events Deleted Dataset Example Source: https://docs.predictleads.com/v3 An example JSON object representing a deleted news event within the dataset. ```json { "data": [ { "id": "ffffb10a-bdd7-4bc7-bb9e-445b8b97df9c", "type": "news_event" } ], "meta": { "schema_version": "3.0", "record_state": "deleted" } } ``` -------------------------------- ### List Startup Platform Posts Source: https://docs.predictleads.com/v3 Retrieves a list of startup platform posts. This endpoint is useful for discovering recent posts from platforms like Hacker News. ```APIDOC ## GET /websites/predictleads_v3/startup_platform_posts ### Description Retrieves a list of startup platform posts, including details such as publication date, post type, and associated company information. ### Method GET ### Endpoint /websites/predictleads_v3/startup_platform_posts ### Parameters #### Query Parameters - **page** (integer) - Optional - Used to specify pagination for performance reasons. If provided, the 'count' field will be included in the meta information. ### Response #### Success Response (200) - **data** (array) - Contains a list of `StartupPlatformPost` objects. - **id** (string) - Unique identifier for the post. - **type** (string) - Type of the post, always "startup_platform_post". - **attributes** (object) - Attributes of the post. - **published_at** (string) - Date and time (ISO 8601) when the post was published. - **post_type** (string) - Indicates the platform where the post was found (e.g., "show_hn", "job_hn"). - **post_url** (string) - URL to the post. - **company_domain** (string) - Domain name of the company associated with the post. - **company_name** (string | null) - Name of the company, if available. - **fuzzy_match** (boolean) - Indicates if the product name extraction was an exact match. - **meta** (object) - Meta information about the dataset. - **schema_version** (string) - The schema version of the objects. - **record_state** (string) - The record state of the objects, typically "active". - **count** (integer) - Total number of results. Only included if the 'page' parameter is provided. ### Response Example { "data": [ { "id": "941340", "type": "startup_platform_post", "attributes": { "published_at": "2024-11-02T19:28:31.000+01:00", "post_type": "show_hn", "post_url": "https://news.ycombinator.com/item?id=42028186", "company_domain": "incrediboxmustard.cc", "company_name": "Incredibox Mustard", "fuzzy_match": false } } ], "meta": { "schema_version": "3.0", "record_state": "active", "count": 344 } } ``` -------------------------------- ### TechnologiesDataset Object Schema Example Source: https://docs.predictleads.com/v3 This JSON object represents an example of the TechnologiesDataset structure, detailing a specific technology and its associated company information. ```json { "data": [ { "id": "70392f20-b531-53cc-afa6-26416c0d582d", "type": "technology", "attributes": { "name": "Salesforce", "description": "Salesforce is a cloud-based CRM platform that helps businesses manage customer interactions, sales, and marketing campaigns. It offers applications for sales, service, marketing, and analytics, enhancing operational efficiency and customer engagement. Known for its scalability, customization, and integration capabilities, Salesforce enables organizations to streamline processes and improve overall performance.", "categories": [ "customer_relationship_management" ], "parent_categories": [ "sales" ], "domain": "salesforce.com", "url": "https://www.salesforce.com", "pricing_data": { "min_usd": 300.0, "max_usd": 1000000.0, "average_spend": 250000.0, "interval": "yearly", "tags": [ "low", "mid", "high", "enterprise", "b2b", "recurring", "saas" ] }, "created_at": "2017-08-24T22:36:09Z" }, "relationships": { "company": { "data": { "id": "9b638313-3fe3-5f5e-a19d-42e122cf06f9", "type": "company" } } } } ], "included": [ { "id": "9b638313-3fe3-5f5e-a19d-42e122cf06f9", "type": "company", "attributes": { "domain": "salesforce.com", "company_name": "Salesforce, Inc.", "ticker": "NYSE:CRM" } } ], "meta": { "schema_version": "3.1", "record_state": "active" } } ``` -------------------------------- ### Retrieve Company Products using Python http.client Source: https://docs.predictleads.com/v3 This Python script demonstrates how to fetch a company's products using the http.client library. Ensure you replace the placeholder values for API key, token, and company ID. ```Python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/companies/{company_id_or_domain}/products", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### PredictLeads API Response Examples Source: https://docs.predictleads.com/v3 This section provides examples of successful API responses and common error responses, including their status codes and JSON structures. ```APIDOC ## PredictLeads API Response Examples ### Description This section provides examples of successful API responses and common error responses, including their status codes and JSON structures. ### Success Response (200) **Description**: Request was successfully processed. ### Request Example ```json { "data": [ { "id": "70392f20-b531-53cc-afa6-26416c0d582d", "type": "technology", "attributes": { "name": "Salesforce", "description": "Salesforce is a cloud-based CRM platform that helps businesses manage customer interactions, sales, and marketing campaigns. It offers applications for sales, service, marketing, and analytics, enhancing operational efficiency and customer engagement. Known for its scalability, customization, and integration capabilities, Salesforce enables organizations to streamline processes and improve overall performance.", "categories": [ "customer_relationship_management" ], "parent_categories": [ "sales" ], "domain": "salesforce.com", "url": "https://www.salesforce.com", "pricing_data": { "min_usd": 300.0, "max_usd": 1000000.0, "average_spend": 250000.0, "interval": "yearly", "tags": [ "low", "mid", "high", "enterprise", "b2b", "recurring", "saas" ] }, "created_at": "2017-08-24T22:36:09Z" }, "relationships": { "company": { "data": { "id": "9b638313-3fe3-5f5e-a19d-42e122cf06f9", "type": "company" } } } } ], "included": [ { "id": "9b638313-3fe3-5f5e-a19d-42e122cf06f9", "type": "company", "attributes": { "domain": "salesforce.com", "company_name": "Salesforce, Inc.", "ticker": "NYSE:CRM" } } ], "meta": { "schema_version": "3.1", "record_state": "active" } } ``` ### Error Responses #### Bad Request (400) **Description**: Invalid request body or parameters. ```json { "error": { "type": "bad_request", "message": "..." } } ``` #### Unauthorized (401) **Description**: Authentication credentials are invalid or API subscription is not activated. ```json { "error": { "type": "unauthorized", "message": "..." } } ``` #### Payment Required (402) **Description**: Exceeded the monthly request limit. ```json { "error": { "type": "payment_required", "message": "You have exceeded the monthly request limit. To minimize your service disruption, you might want to consider upgrading your current API Subscription Plan." } } ``` #### Forbidden (403) **Description**: Request rate over limit. ```json { "error": { "type": "forbidden", "message": "..." } } ``` #### Not Found (404) **Description**: Record not found. ```json { "error": { "type": "not_found", "message": "..." } } ``` #### Unprocessable Content (422) **Description**: Provided data failed to validate. ```json { "error": { "type": "unprocessable_content", "message": "..." } } ``` #### Too Many Requests (429) **Description**: Too many requests in a short time period. Please try again later. ```json { "error": { "type": "too_many_requests", "message": "Too many requests in a short time period. Please try again later." } } ``` #### Internal Server Error (500) **Description**: An internal server error occurred. ```json { "error": { "type": "internal_server_error", "message": "..." } } ``` ``` -------------------------------- ### Startup Platform Posts Dataset Source: https://docs.predictleads.com/v3 Retrieve the latest posts from the startup platform. ```APIDOC ## Startup Platform Posts Dataset ### Description Retrieve the latest posts from the startup platform. ### Method GET ### Endpoint /v3/startup-posts ### Description Retrieve latest posts. ``` -------------------------------- ### Companies Dataset Webhook Payload Example Source: https://docs.predictleads.com/v3 This is an example of the JSON payload received when a company record is updated via the Companies Dataset API webhook. It includes company attributes and relationship data. ```json { "data": [ { "id": "09f851bb-6141-53e4-b265-6397c323dfd3", "type": "company", "attributes": { "domain": "yogaandbeyond.com", "company_name": "Yogaandbeyond", "friendly_company_name": "Yogaandbeyond", "ticker": null, "meta_title": null, "meta_description": null, "description": null, "description_short": null, "language": null, "location": null, "location_data": [], "last_extraction_states": [] }, "relationships": { "redirects_to": { "data": { "id": "d658803d-6d56-5189-a5c2-551ecc93a1db", "type": "company" }, "meta": { "reason": null } }, "parent_company": { "data": null }, "subsidiary_companies": { "data": [] }, "similar_companies": { "data": [] } } } ], "included": [ { "id": "d658803d-6d56-5189-a5c2-551ecc93a1db", "type": "company", "attributes": { "domain": "hugedomains.com", "company_name": "HugeDomains", "ticker": null } } ], "meta": { "schema_version": "3.4", "record_state": "active" } } ``` -------------------------------- ### Retrieve All Technologies (Python http.client) Source: https://docs.predictleads.com/v3 This Python script demonstrates how to retrieve all tracked technologies using the http.client library. It includes setting up the connection and headers for authentication. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/technologies", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Technology Detection Webhook Example Source: https://docs.predictleads.com/v3 This is an example of the request body received when a new technology detection is found for a followed company. It includes details like first and last seen times, firewall status, score, and department codes. ```json { "data": [ { "id": "91f24898-55ab-47a6-a31d-8f03d2a150e5", "type": "technology_detection", "attributes": { "first_seen_at": "2022-05-14T10:18:57Z", "last_seen_at": "2026-06-17T07:11:41Z", "behind_firewall": false, "score": 1.0, "source_count": 36, "department_onet_codes": [ "15-1299.09", "13-1161.00", "15-2051.01", "23-2011.00", "15-1299.08", "11-2021.00", "15-1252.00" ] } } ] } ``` -------------------------------- ### TechnologyDetectionsDataset Object Schema Source: https://docs.predictleads.com/v3 This is an example of the TechnologyDetectionsDataset object schema, illustrating its structure and the types of data it contains. ```json { "data": [ { "id": "91f24898-55ab-47a6-a31d-8f03d2a150e5", "type": "technology_detection", "attributes": { "first_seen_at": "2022-05-14T10:18:57Z", "last_seen_at": "2026-06-17T07:11:41Z", "behind_firewall": false, "score": 1.0, "source_count": 36, "department_onet_codes": [ "15-1299.09", "13-1161.00", "15-2051.01", "23-2011.00", "15-1299.08", "11-2021.00", "15-1252.00" ], "location_data": [ { "city": "San Jose", "state": "California", "country": "United States" }, { "city": "Bucharest", "state": null, "country": "Romania" }, { "city": "New York", "state": "New York", "country": "United States" }, { "city": "Sydney", "state": null, "country": "Australia" }, { "city": null, "state": null, "country": "India" }, { "city": "San Francisco", "state": "California", "country": "United States" }, { "city": "Lehi", "state": "Utah", "country": "United States" } ] }, "relationships": { "technology": { "data": { "id": "f4cb1b99-53c2-5cf4-8801-4608a37727ac", "type": "technology" } }, "company": { "data": { "id": "a1d5bfa7-3a65-5881-a0b5-5bb3a4a7fe87", "type": "company" } }, "seen_on_subpages": { "data": [ { "id": "9d238b2b-fbde-4def-944f-5bbc923b28a1", "type": "detection_on_subpage" }, { "id": "255884b5-08ec-47ca-b02e-f0a7779188eb", "type": "detection_on_subpage" }, { "id": "a2eea531-d801-4c22-ada7-5c1a6c2751b7", "type": "detection_on_subpage" }, { "id": "0d845cfe-3fde-4454-9130-ec6cc3a25853", "type": "detection_on_subpage" }, { "id": "74d40430-caa8-484f-831f-e320b05deb58", "type": "detection_on_subpage" } ] }, "seen_on_job_openings": { "data": [ { "id": "6aa800ff-ce65-4b00-8db0-53d9d61f5e5d", "type": "job_opening" }, { "id": "937ff6e2-d0c7-4f32-938d-cb0de1d55413", "type": "job_opening" }, { "id": "6812a29e-1fb5-4d6f-82e9-3fd7c21bfa73", "type": "job_opening" }, { "id": "b6e15132-ece3-4c88-85fb-916ed109ac39", "type": "job_opening" }, { "id": "0f909bea-8ce9-46f0-b556-fd3b6306214b", "type": "job_opening" } ] }, "seen_on_dns_records": { "data": [] }, "seen_on_connection": { "data": null }, "competitive_technology_detections": { "data": [ { "id": "4852ab0b-9744-4384-baa6-72b321ae8177", "type": "technology_detection" } ], "meta": { "max_source_count": 1 } } } } ], "included": [ { "id": "f4cb1b99-53c2-5cf4-8801-4608a37727ac", "type": "technology", "attributes": { "name": "Qualtrics" } }, { "id": "a1d5bfa7-3a65-5881-a0b5-5bb3a4a7fe87", "type": "company", "attributes": { "domain": "adobe.com", "company_name": "Adobe", "ticker": "NASDAQ:ADBE" } } ] } ``` -------------------------------- ### Retrieve Company Website Evolution using Python http.client Source: https://docs.predictleads.com/v3 This Python script demonstrates how to fetch a company's website evolution data using the http.client library. It includes setting up the connection, headers, and printing the response. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/companies/{company_id_or_domain}/website_evolution", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### JobOpening Object Structure Source: https://docs.predictleads.com/v3 Details the fields available within a JobOpening object, including their types, descriptions, and examples. ```APIDOC ## JobOpening Object ### Description Represents a job opening with various attributes. ### Properties - **first_seen_at** (string) - Date & time (ISO 8601) of when the `JobOpening` was first seen. - *Format*: date-time - *Example*: "2024-09-25T16:09:53Z" - **last_seen_at** (string) - Date & time (ISO 8601) of when the `JobOpening` was last seen. - *Format*: date-time - *Example*: "2024-09-25T16:09:53Z" - **last_processed_at** (string) - Date & time (ISO 8601) of when the `JobOpening` was last sent to processing. - *Format*: date-time - *Example*: "2024-09-25T16:09:53Z" - **contract_types** (array of strings) - Zero or more types describing the `JobOpening`. - *Example*: ["full time", "remote"] - **categories** (array of strings) - Zero or more organizational categories of the `JobOpening`. - *Example*: ["finance", "data_analysis"] - *Enum*: ["administration", "consulting", "data_analysis", "design", "directors", "education", "engineering", "finance", "healthcare_services", "human_resources", "information_technology", "internship", "legal", "management", "marketing", "military_and_protective_services", "operations", "purchasing", "product_management", "quality_assurance", "real_estate", "research", "sales", "software_development", "support", "manual_work", "food"] - **onet_data** (object) - Inferred O*NET data for this `JobOpening`. O*NET is a source and standardization of occupational information. - *Properties*: - **code** (string or null) - O*NET category code representing this `JobOpening`. - *Example*: "29-1021.00" - **family** (string or null) - O*NET family name matching the code for this `JobOpening`. - *Example*: "Healthcare Practitioners and Technical" - **occupation_name** (string or null) - O*NET occupation name matching the code for this `JobOpening`. - *Example*: "Dentists, General" - **posted_at** (string or null) - Date & time (ISO 8601) of when the `JobOpening` was posted. - *Format*: date-time - *Example*: "2024-09-25T16:09:53Z" - **recruiter_data** (object) - Info about the contact responsible for hiring for this `JobOpening`. - *Properties*: - **name** (string or null) - Name of the contact responsible for hiring for this `JobOpening`. - *Example*: "John Doe" - **title** (string or null) - Title of the contact responsible for hiring for this `JobOpening`. - **contact** (string or null) - Contact information for the hiring contact. ``` -------------------------------- ### Retrieve Products List (Python http.client) Source: https://docs.predictleads.com/v3 This Python script uses the http.client library to fetch a list of products. It includes headers for authentication. ```python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/discover/products", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### StartupPlatformPostsDataset Schema Source: https://docs.predictleads.com/v3 Defines the structure for a dataset of startup platform posts, including post details and metadata. This schema is used for successful responses (e.g., 200 OK). ```json { "$schema": "https://json-schema.org/draft/2020-12/schema", "title": "StartupPlatformPostsDataset", "summary": "Information about posts on popular startup platforms.", "description": "Provides information about posts on popular startup platforms by companies that are hiring or\nlaunching new products.\n", "type": "object", "required": [ "data" ], "properties": { "data": { "type": "array", "items": { "title": "StartupPlatformPost", "description": "The `StartupPlatformPost` object.", "type": "object", "required": [ "id", "type", "attributes" ], "properties": { "id": { "description": "ID of the `StartupPlatformPost` object.", "type": "string", "format": "uuid" }, "type": { "description": "Type of the `StartupPlatformPost` object.", "const": "startup_platform_post" }, "attributes": { "description": "Attributes of the `StartupPlatformPost` object.", "type": "object", "required": [ "published_at", "post_type", "post_url", "company_domain", "company_name", "fuzzy_match" ], "properties": { "published_at": { "description": "Date & time (ISO 8601) when the `StartupPlatformPost` was published.", "type": "string", "format": "date-time" }, "post_type": { "description": "Indicates on what startup platform post was found.", "type": "string", "oneOf": [ { "description": "Post on startup platform Hacker News - Show page.", "const": "show_hn" }, { "description": "Post on startup platform Hacker News - Job page.", "const": "job_hn" } ] }, "post_url": { "description": "URL to post.", "type": "string", "format": "uri" }, "company_domain": { "description": "Company domain name.", "type": "string" }, "company_name": { "description": "Company name if available.", "type": [ "string", "null" ] }, "fuzzy_match": { "description": "When true we might not have extracted the product name cleanly. When false exact product name should be extracted well.", "type": [ "boolean" ] } } } } } }, "meta": { "description": "Meta information about `StartupPlatformPostsDataset` object.\n", "type": "object", "required": [ "schema_version", "record_state" ], "properties": { "schema_version": { "title": "Meta.SchemaVersion", "description": "Represents schema version of objects.\n", "type": "string" }, "record_state": { "title": "Meta.RecordState", "description": "Represents record state of objects.\n", "type": "string", "const": "active" }, "count": { "description": "Total number of results.\n
\n**NOTE**: Only included in API responses when the request parameter `page` is provided,\nfor performance reasons.\n", "type": "integer", "example": 344 } } } } } ``` -------------------------------- ### Error Response: Forbidden Source: https://docs.predictleads.com/v3 An example of a 'Forbidden' error response (403). This typically indicates that the request rate has been exceeded. ```JSON { "error": { "type": "forbidden", "message": "..." } } ``` -------------------------------- ### Python HTTP Request Example Source: https://docs.predictleads.com/v3 This snippet demonstrates how to fetch news and events data using Python's http.client library. It includes setting up the connection, headers, and printing the response. ```Python import http.client conn = http.client.HTTPSConnection("predictleads.com") headers = {'X-Api-Key': "{your_api_key}", 'X-Api-Token': "{your_api_token}"} conn.request("GET", "/api/v3/discover/news_events", headers=headers) res = conn.getresponse() data = res.read() print(data.decode("utf-8")) ``` -------------------------------- ### Get ApiSubscription Source: https://docs.predictleads.com/v3 Retrieves the current subscription status along with monthly credit limits and usage details for the API. ```APIDOC ## GET /api/v3/api_subscriptions ### Description Provides the current subscription status along with monthly credit limits and usage details. ### Method GET ### Endpoint /api/v3/api_subscriptions ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **data** (array) - An array of ApiSubscription objects. - **id** (string) - ID of the `ApiSubscription` object. - **type** (string) - Type of the `ApiSubscription` object. - **attributes** (object) - Contains the subscription attributes. - **status** (string) - The status of the current subscription. Enum: `disabled`, `active`, `disabled_due_to_error`. - **monthly_credits_quota** (integer) - The number of credits available per month for the current subscription. - **monthly_credits_used** (integer) - The number of credits used per month for the current subscription. - **meta** (object) - Meta information about `ApiSubscription` object. - **schema_version** (string) - Represents schema version of objects. #### Response Example { "data": [ { "id": "ea20b0c1-3427-4004-91e6-59a27be0c9ed", "type": "api_subscription", "attributes": { "status": "active", "monthly_credits_quota": 100, "monthly_credits_used": 42 } } ], "meta": { "schema_version": "3.0" } } #### Error Response (400) { "error": { "type": "bad_request", "message": "..." } } #### Error Response (401) { "error": { "type": "unauthorized", "message": "Authentication failed" } } #### Error Response (402) { "error": { "type": "payment_required", "message": "You have exceeded the monthly request limit. To minimize your service disruption, you might want to consider upgrading your current API Subscription Plan." } } ```