Skip to content

Repository files navigation

llmpulse

REST API client for LLM Pulse AI visibility analytics.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 1.22.0
  • Package version: 1.22.0
  • Generator version: 7.24.0
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://llmpulse.ai

Requirements.

Python 3.10+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/LLM-Pulse/llmpulse-python.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/LLM-Pulse/llmpulse-python.git)

Then import the package:

import llmpulse

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import llmpulse

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:

import llmpulse
from llmpulse.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://api.llmpulse.ai/api/v1
# See configuration.py for a list of all supported configuration parameters.
configuration = llmpulse.Configuration(
    host = "https://api.llmpulse.ai/api/v1"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: BearerAuth
configuration = llmpulse.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with llmpulse.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = llmpulse.AIModelInsightsApi(api_client)
    project_id = 56 # int | Project ID
    range = 56 # int | Number of days to look back (alternative to from/to) (optional)
    var_from = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    to = '2013-10-20T19:20:30+01:00' # datetime |  (optional)
    granularity = 'granularity_example' # str |  (optional)
    collection_id = 56 # int |  (optional)
    country_code = 'country_code_example' # str | ISO country code (e.g. US, GB, DE) (optional)
    language_code = 'language_code_example' # str | ISO language code (e.g. en, es, de) (optional)
    prompt_type = 'prompt_type_example' # str | Filter by prompt type (search intent) (optional)
    brand_kind = 'brand_kind_example' # str | Filter by brand kind: brand (own brand/products), brand_other (competitors/other brands), non_brand (generic, no brand named). For fair 1:1 brand-vs-competitor comparisons (visibility, share of voice), use non_brand: brand-focused prompts skew results toward the brand they name. The in-app Overview page applies non_brand by default. (optional)
    competitors = 'competitors_example' # str | Comma-separated competitor IDs (unknown IDs return ERR_INVALID_PARAM) (optional)

    try:
        # AI Model Insights summary
        api_instance.get_ai_model_insights_summary(project_id, range=range, var_from=var_from, to=to, granularity=granularity, collection_id=collection_id, country_code=country_code, language_code=language_code, prompt_type=prompt_type, brand_kind=brand_kind, competitors=competitors)
    except ApiException as e:
        print("Exception when calling AIModelInsightsApi->get_ai_model_insights_summary: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://api.llmpulse.ai/api/v1

Class Method HTTP request Description
AIModelInsightsApi get_ai_model_insights_summary GET /reports/ai_model_insights/summary AI Model Insights summary
AIModelInsightsApi get_ai_model_position_distribution GET /reports/ai_model_insights/position_distribution Position distribution comparison
AIModelInsightsApi get_ai_overview_results GET /reports/ai_model_insights/ai_overview_results Google AI Overview result availability
AnnotationsApi create_annotation POST /annotations Create a timeline annotation
AnnotationsApi delete_annotation DELETE /annotations/{id} Delete a timeline annotation
AnnotationsApi list_annotations GET /annotations List timeline annotations
AnnotationsApi update_annotation PATCH /annotations/{id} Update a timeline annotation
AnswersApi get_answer GET /answers/{id} Get one AI response
AnswersApi list_answers GET /answers List AI responses
CitationIntelligenceApi get_cited_url_content GET /citation_intelligence/urls/{url_sha256}/content Cited URL cached content
CitationIntelligenceApi get_cited_url_detail GET /citation_intelligence/urls/{url_sha256} Cited URL detail
CitationIntelligenceApi get_mentions_by_citing_domain GET /citation_intelligence/mentions_by_domain Mention share by citing domain
CitationIntelligenceApi list_citation_groups GET /citation_intelligence/groups Grouped citation intelligence
CitationIntelligenceApi list_cited_url_occurrences GET /citation_intelligence/urls/{url_sha256}/occurrences Cited URL occurrences
CollectionsApi create_collection POST /collections Create a tag
CollectionsApi delete_collection DELETE /collections/{id} Delete a tag
CollectionsApi update_collection PATCH /collections/{id} Update a tag
CompetitorsApi create_competitor POST /competitors Add a competitor
CompetitorsApi delete_competitor DELETE /competitors/{id} Delete a competitor
CompetitorsApi update_competitor PATCH /competitors/{id} Update a competitor
DimensionsApi get_competitor_details GET /dimensions/competitors/{id} Competitor details
DimensionsApi get_project_details GET /dimensions/projects/{id} Project details
DimensionsApi list_agent_bots GET /dimensions/agent_bots AI bot catalog (Scale+)
DimensionsApi list_all_citations GET /dimensions/all_citations List all citations (brand + competitor)
DimensionsApi list_all_mentions GET /dimensions/all_mentions List all mentions (brand + competitor)
DimensionsApi list_citations GET /dimensions/citations List brand citations
DimensionsApi list_collections GET /dimensions/collections List tags/collections
DimensionsApi list_competitor_citations GET /dimensions/competitor_citations List competitor citations
DimensionsApi list_competitor_mentions GET /dimensions/competitor_mentions List competitor mentions
DimensionsApi list_competitors GET /dimensions/competitors List competitors
DimensionsApi list_locales GET /dimensions/locales List locales with data
DimensionsApi list_mentions GET /dimensions/mentions List brand mentions
DimensionsApi list_models GET /dimensions/models List models with data
DimensionsApi list_projects GET /dimensions/projects List projects
DimensionsApi list_prompt_executions GET /dimensions/prompt_executions List prompt executions
DimensionsApi list_prompts GET /dimensions/prompts List prompts
DimensionsApi list_sentiment_categories GET /dimensions/sentiments List sentiment categories
DimensionsApi list_sources GET /dimensions/sources List source URLs
DimensionsApi list_tags GET /dimensions/tags List tags (alias for /collections)
GEOWriterApi create_intelligence_task POST /intelligence_tasks Create a GEO Writer task
GEOWriterApi get_intelligence_task GET /intelligence_tasks/{id} Get a GEO Writer task
GEOWriterApi list_intelligence_tasks GET /intelligence_tasks List GEO Writer tasks
HealthApi ping GET /ping Health check
MetricsApi get_agent_traffic GET /metrics/agent_traffic AI bot crawler traffic (Scale+, Beta)
MetricsApi get_ai_traffic GET /metrics/ai_traffic AI referral traffic (Scale+)
MetricsApi get_prompt_summary GET /metrics/prompt_summary Per-prompt metrics summary
MetricsApi get_share_of_voice GET /metrics/sov Share of Voice
MetricsApi get_summary GET /metrics/summary Aggregated metrics summary
MetricsApi get_timeseries GET /metrics/timeseries Time-series metrics
MetricsApi get_top_sources GET /metrics/top_sources Top cited sources
ProjectsApi create_project POST /projects Create a project (fast mode)
ProjectsApi create_project_draft POST /project_drafts Start a project draft (wizard step 1)
ProjectsApi finalize_project_draft POST /project_drafts/{id}/finalize Finalize a draft into a real project
ProjectsApi get_project_draft GET /project_drafts/{id} Read a project draft
ProjectsApi update_project_draft PATCH /project_drafts/{id} Submit a wizard step
PromptsApi assign_prompt_tags POST /prompts/assign_tags Bulk-attach tags to prompts
PromptsApi create_prompts POST /prompts Bulk-create prompts
PromptsApi delete_prompt DELETE /prompts/{id} Delete a prompt
RecommendationsApi get_recommendation GET /recommendations/{id} Get recommendation run with items
RecommendationsApi launch_recommendations POST /recommendations Launch a recommendations generation
RecommendationsApi list_recommendations GET /recommendations List recommendation runs
ReportsApi create_technical_geo_reports POST /technical_geo_reports Run technical GEO analysis
SearchConsoleApi get_search_console_pages GET /search_console/pages Top Search Console pages (Growth+)
SearchConsoleApi get_search_console_queries GET /search_console/queries Top Search Console queries (Growth+)
SearchConsoleApi get_search_console_summary GET /search_console/summary Search Console summary (Growth+)
SearchConsoleApi get_search_console_timeseries GET /search_console/timeseries Search Console time series (Growth+)
SentimentsApi list_sentiment_records GET /sentiments List sentiment records
WebhooksApi create_webhook POST /webhooks Create a webhook subscription
WebhooksApi delete_webhook DELETE /webhooks/{id} Delete a webhook subscription
WebhooksApi list_webhooks GET /webhooks List webhook subscriptions
WebhooksApi sample_webhook_payloads GET /webhooks/sample/{event_type} Sample event payloads

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

BearerAuth

  • Type: Bearer authentication

Author

info@llmpulse.ai

Releases

Packages

Contributors

Languages