influshipapi

package module
v0.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 24, 2026 License: Apache-2.0 Imports: 20 Imported by: 0

README

Influship Go API Library

Go Reference

The Influship Go library provides convenient access to the Influship REST API from applications written in Go.

It is generated with Stainless.

MCP Server

Use the Influship MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

Add to Cursor Install in VS Code

Note: You may need to set environment variables in your MCP client.

Installation

import (
	"github.com/Influship/influship-go" // imported as influshipapi
)

Or to pin the version:

go get -u 'github.com/Influship/influship-go@v0.0.2'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/Influship/influship-go"
	"github.com/Influship/influship-go/option"
)

func main() {
	client := influshipapi.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("INFLUSHIP_API_KEY")
	)
	search, err := client.Search.New(context.TODO(), influshipapi.SearchNewParams{
		Query: "sustainable fashion creators with engaged audiences",
		Limit: influshipapi.Int(25),
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", search.SearchID)
}

Request fields

The influshipapi library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `json:"...,required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, influshipapi.String(string), influshipapi.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := influshipapi.ExampleParams{
	ID:   "id_xxx",                   // required property
	Name: influshipapi.String("..."), // optional property

	Point: influshipapi.Point{
		X: 0,                   // required field will serialize as 0
		Y: influshipapi.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: influshipapi.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[influshipapi.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := influshipapi.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Search.New(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

iter := client.Search.GetAutoPaging(
	context.TODO(),
	"search_abc123",
	influshipapi.SearchGetParams{
		Cursor: influshipapi.String("eyJvZmZzZXQiOjEwfQ=="),
		Limit:  influshipapi.Int(10),
	},
)
// Automatically fetches more pages as needed.
for iter.Next() {
	searchGetResponse := iter.Current()
	fmt.Printf("%+v\n", searchGetResponse)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

page, err := client.Search.Get(
	context.TODO(),
	"search_abc123",
	influshipapi.SearchGetParams{
		Cursor: influshipapi.String("eyJvZmZzZXQiOjEwfQ=="),
		Limit:  influshipapi.Int(10),
	},
)
for page != nil {
	for _, search := range page.Data {
		fmt.Printf("%+v\n", search)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *influshipapi.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Search.New(context.TODO(), influshipapi.SearchNewParams{
	Query: "fitness influencers in Los Angeles",
	Limit: influshipapi.Int(10),
})
if err != nil {
	var apierr *influshipapi.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/v1/search": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Search.New(
	ctx,
	influshipapi.SearchNewParams{
		Query: "fitness influencers in Los Angeles",
		Limit: influshipapi.Int(10),
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper influshipapi.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := influshipapi.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Search.New(
	context.TODO(),
	influshipapi.SearchNewParams{
		Query: "fitness influencers in Los Angeles",
		Limit: influshipapi.Int(10),
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
search, err := client.Search.New(
	context.TODO(),
	influshipapi.SearchNewParams{
		Query: "fitness influencers in Los Angeles",
		Limit: influshipapi.Int(10),
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", search)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: influshipapi.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := influshipapi.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

View Source
const ProfileSummaryPlatformInstagram = shared.ProfileSummaryPlatformInstagram

Equals "instagram"

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (INFLUSHIP_API_KEY, INFLUSHIP_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type Client

type Client struct {

	// API health and status endpoints
	Health HealthService
	// Retrieve creator profiles and discover new creators through search,
	// autocomplete, and lookalike matching. Creators are cross-platform entities that
	// may have profiles on multiple social networks.
	Creators CreatorService
	// AI-powered semantic search to find creators using natural language queries.
	// Understands intent and context to match creators based on content themes,
	// audience, and style.
	Search SearchService
	// Access individual social media profiles with detailed metrics, growth data, and
	// activity information. Profiles are platform-specific accounts linked to
	// creators.
	Profiles ProfileService
	// Retrieve and analyze social media posts with engagement metrics, media content,
	// and performance data.
	Posts PostService
	Raw   RawService
	// contains filtered or unexported fields
}

Client creates a struct with services and top level methods that help with interacting with the Influship API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (INFLUSHIP_API_KEY, INFLUSHIP_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

type CreatorAutocompleteParams

type CreatorAutocompleteParams struct {
	// Search query (min 2 characters)
	Q string `query:"q" api:"required" json:"-"`
	// Maximum results to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter by platform
	//
	// Any of "instagram".
	Platform CreatorAutocompleteParamsPlatform `query:"platform,omitzero" json:"-"`
	// Which platforms to include in results
	//
	// Any of "creator_only", "matched_platforms", "all_platforms".
	Scope CreatorAutocompleteParamsScope `query:"scope,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CreatorAutocompleteParams) URLQuery

func (r CreatorAutocompleteParams) URLQuery() (v url.Values, err error)

URLQuery serializes CreatorAutocompleteParams's query parameters as `url.Values`.

type CreatorAutocompleteParamsPlatform

type CreatorAutocompleteParamsPlatform string

Filter by platform

const (
	CreatorAutocompleteParamsPlatformInstagram CreatorAutocompleteParamsPlatform = "instagram"
)

type CreatorAutocompleteParamsScope

type CreatorAutocompleteParamsScope string

Which platforms to include in results

const (
	CreatorAutocompleteParamsScopeCreatorOnly      CreatorAutocompleteParamsScope = "creator_only"
	CreatorAutocompleteParamsScopeMatchedPlatforms CreatorAutocompleteParamsScope = "matched_platforms"
	CreatorAutocompleteParamsScopeAllPlatforms     CreatorAutocompleteParamsScope = "all_platforms"
)

type CreatorAutocompleteResponse

type CreatorAutocompleteResponse struct {
	// Autocomplete results
	Data []CreatorAutocompleteResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorAutocompleteResponse) RawJSON

func (r CreatorAutocompleteResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CreatorAutocompleteResponse) UnmarshalJSON

func (r *CreatorAutocompleteResponse) UnmarshalJSON(data []byte) error

type CreatorAutocompleteResponseData

type CreatorAutocompleteResponseData struct {
	// Creator ID
	ID string `json:"id" api:"required" format:"uuid"`
	// Avatar URL
	Avatar string `json:"avatar" api:"required" format:"uri"`
	// Creator name
	Name string `json:"name" api:"required"`
	// Matching platforms
	Platforms []CreatorAutocompleteResponseDataPlatform `json:"platforms" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Avatar      respjson.Field
		Name        respjson.Field
		Platforms   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorAutocompleteResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*CreatorAutocompleteResponseData) UnmarshalJSON

func (r *CreatorAutocompleteResponseData) UnmarshalJSON(data []byte) error

type CreatorAutocompleteResponseDataPlatform

type CreatorAutocompleteResponseDataPlatform struct {
	DisplayName string `json:"display_name" api:"required"`
	// The field value that matched
	MatchField string `json:"match_field" api:"required"`
	// How the query matched this profile
	//
	// Any of "name", "username", "display_name".
	MatchType string `json:"match_type" api:"required"`
	// Social media platform
	//
	// Any of "instagram".
	Platform string `json:"platform" api:"required"`
	Username string `json:"username" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DisplayName respjson.Field
		MatchField  respjson.Field
		MatchType   respjson.Field
		Platform    respjson.Field
		Username    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorAutocompleteResponseDataPlatform) RawJSON

Returns the unmodified JSON received from the API

func (*CreatorAutocompleteResponseDataPlatform) UnmarshalJSON

func (r *CreatorAutocompleteResponseDataPlatform) UnmarshalJSON(data []byte) error

type CreatorBasic

type CreatorBasic = shared.CreatorBasic

Basic creator information

This is an alias to an internal type.

type CreatorGetParams

type CreatorGetParams struct {
	// Additional data to include in response
	//
	// Any of "profiles".
	Include []string `query:"include,omitzero" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (CreatorGetParams) URLQuery

func (r CreatorGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes CreatorGetParams's query parameters as `url.Values`.

type CreatorGetResponse

type CreatorGetResponse struct {
	// Full creator details
	Data CreatorGetResponseData `json:"data" api:"required"`
	// Present when partial results were returned because one or more linked profiles
	// were skipped for data integrity reasons.
	Warning string `json:"warning"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Warning     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorGetResponse) RawJSON

func (r CreatorGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CreatorGetResponse) UnmarshalJSON

func (r *CreatorGetResponse) UnmarshalJSON(data []byte) error

type CreatorGetResponseData

type CreatorGetResponseData struct {
	// Creator unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// AI-generated summary of the creator
	AISummary string `json:"ai_summary" api:"required"`
	// Avatar URL
	AvatarURL string `json:"avatar_url" api:"required" format:"uri"`
	// Creator bio
	Bio string `json:"bio" api:"required"`
	// Content themes/topics
	ContentThemes []string `json:"content_themes" api:"required"`
	// Creator display name
	Name string `json:"name" api:"required"`
	// Social profiles (only included when include=profiles)
	Profiles []shared.ProfileSummary `json:"profiles"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		AISummary     respjson.Field
		AvatarURL     respjson.Field
		Bio           respjson.Field
		ContentThemes respjson.Field
		Name          respjson.Field
		Profiles      respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Full creator details

func (CreatorGetResponseData) RawJSON

func (r CreatorGetResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*CreatorGetResponseData) UnmarshalJSON

func (r *CreatorGetResponseData) UnmarshalJSON(data []byte) error

type CreatorLookalikeParams

type CreatorLookalikeParams struct {
	// Seed creators to find similar creators for
	Seeds []CreatorLookalikeParamsSeed `json:"seeds,omitzero" api:"required"`
	// Pagination cursor for next page
	Cursor param.Opt[string] `json:"cursor,omitzero"`
	// Maximum results to return
	Limit param.Opt[int64] `json:"limit,omitzero"`
	// Additional filters
	Filters CreatorLookalikeParamsFilters `json:"filters,omitzero"`
	// contains filtered or unexported fields
}

func (CreatorLookalikeParams) MarshalJSON

func (r CreatorLookalikeParams) MarshalJSON() (data []byte, err error)

func (*CreatorLookalikeParams) UnmarshalJSON

func (r *CreatorLookalikeParams) UnmarshalJSON(data []byte) error

type CreatorLookalikeParamsFilters

type CreatorLookalikeParamsFilters struct {
	// Filter by verified status
	Verified param.Opt[bool] `json:"verified,omitzero"`
	// Filter by engagement rate
	EngagementRate CreatorLookalikeParamsFiltersEngagementRate `json:"engagement_rate,omitzero"`
	// Filter by follower count
	Followers CreatorLookalikeParamsFiltersFollowers `json:"followers,omitzero"`
	// contains filtered or unexported fields
}

Additional filters

func (CreatorLookalikeParamsFilters) MarshalJSON

func (r CreatorLookalikeParamsFilters) MarshalJSON() (data []byte, err error)

func (*CreatorLookalikeParamsFilters) UnmarshalJSON

func (r *CreatorLookalikeParamsFilters) UnmarshalJSON(data []byte) error

type CreatorLookalikeParamsFiltersEngagementRate

type CreatorLookalikeParamsFiltersEngagementRate struct {
	// Maximum engagement rate (%)
	Max param.Opt[float64] `json:"max,omitzero"`
	// Minimum engagement rate (%)
	Min param.Opt[float64] `json:"min,omitzero"`
	// contains filtered or unexported fields
}

Filter by engagement rate

func (CreatorLookalikeParamsFiltersEngagementRate) MarshalJSON

func (r CreatorLookalikeParamsFiltersEngagementRate) MarshalJSON() (data []byte, err error)

func (*CreatorLookalikeParamsFiltersEngagementRate) UnmarshalJSON

func (r *CreatorLookalikeParamsFiltersEngagementRate) UnmarshalJSON(data []byte) error

type CreatorLookalikeParamsFiltersFollowers

type CreatorLookalikeParamsFiltersFollowers struct {
	// Maximum follower count
	Max param.Opt[float64] `json:"max,omitzero"`
	// Minimum follower count
	Min param.Opt[float64] `json:"min,omitzero"`
	// contains filtered or unexported fields
}

Filter by follower count

func (CreatorLookalikeParamsFiltersFollowers) MarshalJSON

func (r CreatorLookalikeParamsFiltersFollowers) MarshalJSON() (data []byte, err error)

func (*CreatorLookalikeParamsFiltersFollowers) UnmarshalJSON

func (r *CreatorLookalikeParamsFiltersFollowers) UnmarshalJSON(data []byte) error

type CreatorLookalikeParamsSeed

type CreatorLookalikeParamsSeed struct {
	// Creator ID (use this OR platform+username)
	CreatorID param.Opt[string] `json:"creator_id,omitzero" format:"uuid"`
	// Username (required with platform)
	Username param.Opt[string] `json:"username,omitzero"`
	// Weight for this seed (0-1)
	Weight param.Opt[float64] `json:"weight,omitzero"`
	// Platform (required with username)
	//
	// Any of "instagram".
	Platform string `json:"platform,omitzero"`
	// contains filtered or unexported fields
}

Seed creator for lookalike search

func (CreatorLookalikeParamsSeed) MarshalJSON

func (r CreatorLookalikeParamsSeed) MarshalJSON() (data []byte, err error)

func (*CreatorLookalikeParamsSeed) UnmarshalJSON

func (r *CreatorLookalikeParamsSeed) UnmarshalJSON(data []byte) error

type CreatorLookalikeResponse

type CreatorLookalikeResponse struct {
	// Basic creator information
	Creator shared.CreatorBasic `json:"creator" api:"required"`
	// Abbreviated profile information
	PrimaryProfile shared.ProfileSummary `json:"primary_profile" api:"required"`
	// Similarity information for lookalike match
	Similarity CreatorLookalikeResponseSimilarity `json:"similarity" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Creator        respjson.Field
		PrimaryProfile respjson.Field
		Similarity     respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorLookalikeResponse) RawJSON

func (r CreatorLookalikeResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CreatorLookalikeResponse) UnmarshalJSON

func (r *CreatorLookalikeResponse) UnmarshalJSON(data []byte) error

type CreatorLookalikeResponseSimilarity

type CreatorLookalikeResponseSimilarity struct {
	// Similarity score (0-1)
	Score float64 `json:"score" api:"required"`
	// Shared traits with seed creators
	SharedTraits []string `json:"shared_traits" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Score        respjson.Field
		SharedTraits respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Similarity information for lookalike match

func (CreatorLookalikeResponseSimilarity) RawJSON

Returns the unmodified JSON received from the API

func (*CreatorLookalikeResponseSimilarity) UnmarshalJSON

func (r *CreatorLookalikeResponseSimilarity) UnmarshalJSON(data []byte) error

type CreatorMatchParams

type CreatorMatchParams struct {
	// Creators to evaluate
	Creators []CreatorMatchParamsCreator `json:"creators,omitzero" api:"required"`
	// Campaign intent for creator matching
	Intent CreatorMatchParamsIntent `json:"intent,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (CreatorMatchParams) MarshalJSON

func (r CreatorMatchParams) MarshalJSON() (data []byte, err error)

func (*CreatorMatchParams) UnmarshalJSON

func (r *CreatorMatchParams) UnmarshalJSON(data []byte) error

type CreatorMatchParamsCreator

type CreatorMatchParamsCreator struct {
	// Creator ID (use this OR platform+username)
	CreatorID param.Opt[string] `json:"creator_id,omitzero" format:"uuid"`
	// Username (required with platform)
	Username param.Opt[string] `json:"username,omitzero"`
	// Platform (required with username)
	//
	// Any of "instagram".
	Platform string `json:"platform,omitzero"`
	// contains filtered or unexported fields
}

Creator identifier for match endpoint

func (CreatorMatchParamsCreator) MarshalJSON

func (r CreatorMatchParamsCreator) MarshalJSON() (data []byte, err error)

func (*CreatorMatchParamsCreator) UnmarshalJSON

func (r *CreatorMatchParamsCreator) UnmarshalJSON(data []byte) error

type CreatorMatchParamsIntent

type CreatorMatchParamsIntent struct {
	// Campaign description
	Query string `json:"query" api:"required"`
	// Additional context about the campaign
	Context param.Opt[string] `json:"context,omitzero"`
	// contains filtered or unexported fields
}

Campaign intent for creator matching

The property Query is required.

func (CreatorMatchParamsIntent) MarshalJSON

func (r CreatorMatchParamsIntent) MarshalJSON() (data []byte, err error)

func (*CreatorMatchParamsIntent) UnmarshalJSON

func (r *CreatorMatchParamsIntent) UnmarshalJSON(data []byte) error

type CreatorMatchResponse

type CreatorMatchResponse struct {
	Data []CreatorMatchResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorMatchResponse) RawJSON

func (r CreatorMatchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CreatorMatchResponse) UnmarshalJSON

func (r *CreatorMatchResponse) UnmarshalJSON(data []byte) error

type CreatorMatchResponseData

type CreatorMatchResponseData struct {
	Creator CreatorMatchResponseDataCreator `json:"creator" api:"required"`
	Input   CreatorMatchResponseDataInput   `json:"input" api:"required"`
	Match   CreatorMatchResponseDataMatch   `json:"match" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Creator     respjson.Field
		Input       respjson.Field
		Match       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorMatchResponseData) RawJSON

func (r CreatorMatchResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*CreatorMatchResponseData) UnmarshalJSON

func (r *CreatorMatchResponseData) UnmarshalJSON(data []byte) error

type CreatorMatchResponseDataCreator

type CreatorMatchResponseDataCreator struct {
	ID        string `json:"id" api:"required" format:"uuid"`
	AvatarURL string `json:"avatar_url" api:"required" format:"uri"`
	Name      string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		AvatarURL   respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorMatchResponseDataCreator) RawJSON

Returns the unmodified JSON received from the API

func (*CreatorMatchResponseDataCreator) UnmarshalJSON

func (r *CreatorMatchResponseDataCreator) UnmarshalJSON(data []byte) error

type CreatorMatchResponseDataInput

type CreatorMatchResponseDataInput struct {
	CreatorID string `json:"creator_id" format:"uuid"`
	// Social media platform
	//
	// Any of "instagram".
	Platform string `json:"platform"`
	Username string `json:"username"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatorID   respjson.Field
		Platform    respjson.Field
		Username    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorMatchResponseDataInput) RawJSON

Returns the unmodified JSON received from the API

func (*CreatorMatchResponseDataInput) UnmarshalJSON

func (r *CreatorMatchResponseDataInput) UnmarshalJSON(data []byte) error

type CreatorMatchResponseDataMatch

type CreatorMatchResponseDataMatch struct {
	// Match decision recommendation
	//
	// Any of "good", "neutral", "avoid".
	Decision string `json:"decision" api:"required"`
	// Structured reasons supporting the decision
	Reasons []CreatorMatchResponseDataMatchReason `json:"reasons" api:"required"`
	// Match score (0-1)
	Score float64 `json:"score" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Decision    respjson.Field
		Reasons     respjson.Field
		Score       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorMatchResponseDataMatch) RawJSON

Returns the unmodified JSON received from the API

func (*CreatorMatchResponseDataMatch) UnmarshalJSON

func (r *CreatorMatchResponseDataMatch) UnmarshalJSON(data []byte) error

type CreatorMatchResponseDataMatchReason

type CreatorMatchResponseDataMatchReason struct {
	// Human-readable reason for the match
	Text string `json:"text" api:"required"`
	// ID of the supporting fact, if applicable
	FactID string `json:"fact_id"`
	// ID of the source post, if applicable
	SourcePostID string `json:"source_post_id"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Text         respjson.Field
		FactID       respjson.Field
		SourcePostID respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CreatorMatchResponseDataMatchReason) RawJSON

Returns the unmodified JSON received from the API

func (*CreatorMatchResponseDataMatchReason) UnmarshalJSON

func (r *CreatorMatchResponseDataMatchReason) UnmarshalJSON(data []byte) error

type CreatorService

type CreatorService struct {
	// contains filtered or unexported fields
}

Retrieve creator profiles and discover new creators through search, autocomplete, and lookalike matching. Creators are cross-platform entities that may have profiles on multiple social networks.

CreatorService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCreatorService method instead.

func NewCreatorService

func NewCreatorService(opts ...option.RequestOption) (r CreatorService)

NewCreatorService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CreatorService) Autocomplete

Fast typeahead search for creators by name or username. Optimized for search-as-you-type UIs with sub-100ms response times.

**Matching behavior:**

- Matches against creator name, username, and display name - Results include which field matched and the matching value - Prefix matching (e.g., "fit" matches "fitness_coach")

**Scope options:**

- `creator_only`: Return only the creator entity - `matched_platforms`: Return only profiles that matched the query - `all_platforms`: Return all linked profiles (default)

**Pricing**: 0.05 credits per request ($0.0005)

func (*CreatorService) Get

Retrieve a creator's profile including AI-generated summary, content themes, and optionally their linked social profiles.

**What is a Creator?** A creator is a cross-platform entity representing a person or brand. They may have profiles on multiple social networks (Instagram, YouTube, TikTok, etc.) that are linked together.

**Include options:**

- `profiles`: Include all linked social profiles with metrics

**Pricing**: 0.1 credits per request ($0.001)

func (*CreatorService) Lookalike

Find creators similar to provided seed creators using AI-powered similarity matching. Analyzes content themes, audience overlap, posting style, and engagement patterns.

**Use cases:**

- Expand campaigns with creators similar to proven performers - Find alternatives when preferred creators are unavailable - Discover emerging creators in the same niche

**How it works:**

1. Provide 1-10 seed creators (by ID or platform/username) 2. Optionally weight seeds to prioritize certain creators 3. Get ranked results with similarity scores and shared traits

**Pricing**: 1.5 credits per creator returned ($0.015)

func (*CreatorService) LookalikeAutoPaging

Find creators similar to provided seed creators using AI-powered similarity matching. Analyzes content themes, audience overlap, posting style, and engagement patterns.

**Use cases:**

- Expand campaigns with creators similar to proven performers - Find alternatives when preferred creators are unavailable - Discover emerging creators in the same niche

**How it works:**

1. Provide 1-10 seed creators (by ID or platform/username) 2. Optionally weight seeds to prioritize certain creators 3. Get ranked results with similarity scores and shared traits

**Pricing**: 1.5 credits per creator returned ($0.015)

func (*CreatorService) Match

Evaluate how well creators match a specific campaign using AI analysis. Returns a fit score (0-1), decision recommendation (good/neutral/avoid), and evidence-based explanations.

**Use cases:**

- Vet shortlisted creators before outreach - Rank candidates for a specific campaign - Get AI-generated talking points for why a creator fits

**How it works:**

1. Describe your campaign intent and target audience 2. Provide up to 100 creators to evaluate 3. Get detailed scores with explanations and evidence

**Pricing**: 1 credit per creator scored ($0.01)

type Error

type Error = apierror.Error

type HealthCheckResponse

type HealthCheckResponse struct {
	// Service health status
	Ok bool `json:"ok" api:"required"`
	// Current server timestamp
	Timestamp time.Time `json:"timestamp" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Ok          respjson.Field
		Timestamp   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Health check response

func (HealthCheckResponse) RawJSON

func (r HealthCheckResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*HealthCheckResponse) UnmarshalJSON

func (r *HealthCheckResponse) UnmarshalJSON(data []byte) error

type HealthService

type HealthService struct {
	// contains filtered or unexported fields
}

API health and status endpoints

HealthService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewHealthService method instead.

func NewHealthService

func NewHealthService(opts ...option.RequestOption) (r HealthService)

NewHealthService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*HealthService) Check

func (r *HealthService) Check(ctx context.Context, opts ...option.RequestOption) (res *HealthCheckResponse, err error)

Check API health status. No authentication required.

type MatchInfo

type MatchInfo struct {
	// Human-readable match reasons
	Reasons []string `json:"reasons" api:"required"`
	// Match relevance score (0-1)
	Score float64 `json:"score" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Reasons     respjson.Field
		Score       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Search match information

func (MatchInfo) RawJSON

func (r MatchInfo) RawJSON() string

Returns the unmodified JSON received from the API

func (*MatchInfo) UnmarshalJSON

func (r *MatchInfo) UnmarshalJSON(data []byte) error

type PostListParams

type PostListParams struct {
	// Creator ID (use this OR platform+username)
	CreatorID param.Opt[string] `query:"creator_id,omitzero" format:"uuid" json:"-"`
	// Pagination cursor for next page
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum posts to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Username (required with platform)
	Username param.Opt[string] `query:"username,omitzero" json:"-"`
	// Platform (required with username)
	//
	// Any of "instagram".
	Platform PostListParamsPlatform `query:"platform,omitzero" json:"-"`
	// Sort order
	//
	// Any of "recent", "top_engagement", "most_likes", "most_views", "most_comments".
	Sort PostListParamsSort `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (PostListParams) URLQuery

func (r PostListParams) URLQuery() (v url.Values, err error)

URLQuery serializes PostListParams's query parameters as `url.Values`.

type PostListParamsPlatform

type PostListParamsPlatform string

Platform (required with username)

const (
	PostListParamsPlatformInstagram PostListParamsPlatform = "instagram"
)

type PostListParamsSort

type PostListParamsSort string

Sort order

const (
	PostListParamsSortRecent        PostListParamsSort = "recent"
	PostListParamsSortTopEngagement PostListParamsSort = "top_engagement"
	PostListParamsSortMostLikes     PostListParamsSort = "most_likes"
	PostListParamsSortMostViews     PostListParamsSort = "most_views"
	PostListParamsSortMostComments  PostListParamsSort = "most_comments"
)

type PostListResponse

type PostListResponse struct {
	// Post unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// Post caption
	Caption string `json:"caption" api:"required"`
	// Hashtags used in the post
	Hashtags []string `json:"hashtags" api:"required"`
	// Post location information
	Location PostListResponseLocation `json:"location" api:"required"`
	// Post media information
	Media PostListResponseMedia `json:"media" api:"required"`
	// Usernames mentioned in the post
	Mentions []string `json:"mentions" api:"required"`
	// Post engagement metrics
	Metrics PostListResponseMetrics `json:"metrics" api:"required"`
	// Social media platform
	//
	// Any of "instagram".
	Platform PostListResponsePlatform `json:"platform" api:"required"`
	// Platform-specific post ID
	PlatformID string `json:"platform_id" api:"required"`
	// Post timestamp
	PostedAt time.Time `json:"posted_at" api:"required" format:"date-time"`
	// Profile unique identifier
	ProfileID string `json:"profile_id" api:"required" format:"uuid"`
	// Type of post
	//
	// Any of "image", "video", "carousel", "reel", "story".
	Type PostListResponseType `json:"type" api:"required"`
	// Post URL
	URL string `json:"url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Caption     respjson.Field
		Hashtags    respjson.Field
		Location    respjson.Field
		Media       respjson.Field
		Mentions    respjson.Field
		Metrics     respjson.Field
		Platform    respjson.Field
		PlatformID  respjson.Field
		PostedAt    respjson.Field
		ProfileID   respjson.Field
		Type        respjson.Field
		URL         respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Full post details

func (PostListResponse) RawJSON

func (r PostListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*PostListResponse) UnmarshalJSON

func (r *PostListResponse) UnmarshalJSON(data []byte) error

type PostListResponseLocation

type PostListResponseLocation struct {
	// Location name
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Post location information

func (PostListResponseLocation) RawJSON

func (r PostListResponseLocation) RawJSON() string

Returns the unmodified JSON received from the API

func (*PostListResponseLocation) UnmarshalJSON

func (r *PostListResponseLocation) UnmarshalJSON(data []byte) error

type PostListResponseMedia

type PostListResponseMedia struct {
	// Video duration in seconds
	DurationSeconds float64 `json:"duration_seconds" api:"required"`
	// Thumbnail URL
	ThumbnailURL string `json:"thumbnail_url" api:"required" format:"uri"`
	// Media URL
	URL string `json:"url" api:"required" format:"uri"`
	// Video URL (for video content)
	VideoURL string `json:"video_url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		DurationSeconds respjson.Field
		ThumbnailURL    respjson.Field
		URL             respjson.Field
		VideoURL        respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Post media information

func (PostListResponseMedia) RawJSON

func (r PostListResponseMedia) RawJSON() string

Returns the unmodified JSON received from the API

func (*PostListResponseMedia) UnmarshalJSON

func (r *PostListResponseMedia) UnmarshalJSON(data []byte) error

type PostListResponseMetrics

type PostListResponseMetrics struct {
	// Comment count
	Comments int64 `json:"comments" api:"required"`
	// Engagement rate for this post as a percentage (e.g. 3.8 means 3.8%)
	EngagementRate float64 `json:"engagement_rate" api:"required"`
	// Like count
	Likes int64 `json:"likes" api:"required"`
	// Share count
	Shares int64 `json:"shares" api:"required"`
	// View count (for video content)
	Views int64 `json:"views" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Comments       respjson.Field
		EngagementRate respjson.Field
		Likes          respjson.Field
		Shares         respjson.Field
		Views          respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Post engagement metrics

func (PostListResponseMetrics) RawJSON

func (r PostListResponseMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*PostListResponseMetrics) UnmarshalJSON

func (r *PostListResponseMetrics) UnmarshalJSON(data []byte) error

type PostListResponsePlatform

type PostListResponsePlatform string

Social media platform

const (
	PostListResponsePlatformInstagram PostListResponsePlatform = "instagram"
)

type PostListResponseType

type PostListResponseType string

Type of post

const (
	PostListResponseTypeImage    PostListResponseType = "image"
	PostListResponseTypeVideo    PostListResponseType = "video"
	PostListResponseTypeCarousel PostListResponseType = "carousel"
	PostListResponseTypeReel     PostListResponseType = "reel"
	PostListResponseTypeStory    PostListResponseType = "story"
)

type PostService

type PostService struct {
	// contains filtered or unexported fields
}

Retrieve and analyze social media posts with engagement metrics, media content, and performance data.

PostService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewPostService method instead.

func NewPostService

func NewPostService(opts ...option.RequestOption) (r PostService)

NewPostService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*PostService) List

Retrieve posts for a creator or profile with engagement metrics and media data.

**Query options:**

- By creator: Use `creator_id` to get posts across all their profiles - By profile: Use `platform` + `username` for a specific profile's posts

**Sort options:**

- `recent`: Most recent posts first (default) - `top_engagement`: Highest engagement rate first - `most_likes`: Most likes first - `most_views`: Most views first (video content) - `most_comments`: Most comments first

**Pricing**: 0.05 credits per post returned ($0.0005)

func (*PostService) ListAutoPaging

Retrieve posts for a creator or profile with engagement metrics and media data.

**Query options:**

- By creator: Use `creator_id` to get posts across all their profiles - By profile: Use `platform` + `username` for a specific profile's posts

**Sort options:**

- `recent`: Most recent posts first (default) - `top_engagement`: Highest engagement rate first - `most_likes`: Most likes first - `most_views`: Most views first (video content) - `most_comments`: Most comments first

**Pricing**: 0.05 credits per post returned ($0.0005)

type ProfileActivity

type ProfileActivity struct {
	// Timestamp of last post
	LastPostAt time.Time `json:"last_post_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LastPostAt  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Profile activity information

func (ProfileActivity) RawJSON

func (r ProfileActivity) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileActivity) UnmarshalJSON

func (r *ProfileActivity) UnmarshalJSON(data []byte) error

type ProfileGetParams

type ProfileGetParams struct {
	// Platform name
	Platform string `path:"platform" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type ProfileGetResponse

type ProfileGetResponse struct {
	// Full profile details
	Data ProfileResponseData `json:"data" api:"required"`
	// Present when partial results were returned because profile metrics/data were
	// skipped due to integrity issues.
	Warning string `json:"warning"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Warning     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileGetResponse) RawJSON

func (r ProfileGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileGetResponse) UnmarshalJSON

func (r *ProfileGetResponse) UnmarshalJSON(data []byte) error

type ProfileGrowth

type ProfileGrowth struct {
	// Follower growth percentage over 30 days (e.g. 2.5 means +2.5%)
	Followers30dPct float64 `json:"followers_30d_pct" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Followers30dPct respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Profile growth statistics

func (ProfileGrowth) RawJSON

func (r ProfileGrowth) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileGrowth) UnmarshalJSON

func (r *ProfileGrowth) UnmarshalJSON(data []byte) error

type ProfileLookupParams

type ProfileLookupParams struct {
	// Profiles to lookup
	Profiles []ProfileLookupParamsProfile `json:"profiles,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (ProfileLookupParams) MarshalJSON

func (r ProfileLookupParams) MarshalJSON() (data []byte, err error)

func (*ProfileLookupParams) UnmarshalJSON

func (r *ProfileLookupParams) UnmarshalJSON(data []byte) error

type ProfileLookupParamsProfile

type ProfileLookupParamsProfile struct {
	// Social media platform
	//
	// Any of "instagram".
	Platform string `json:"platform,omitzero" api:"required"`
	// Username to lookup
	Username string `json:"username" api:"required"`
	// contains filtered or unexported fields
}

The properties Platform, Username are required.

func (ProfileLookupParamsProfile) MarshalJSON

func (r ProfileLookupParamsProfile) MarshalJSON() (data []byte, err error)

func (*ProfileLookupParamsProfile) UnmarshalJSON

func (r *ProfileLookupParamsProfile) UnmarshalJSON(data []byte) error

type ProfileLookupResponse

type ProfileLookupResponse struct {
	// Profiles that were found
	Data []ProfileResponseData `json:"data" api:"required"`
	// Profiles that were not found
	NotFound []ProfileLookupResponseNotFound `json:"not_found" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		NotFound    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileLookupResponse) RawJSON

func (r ProfileLookupResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileLookupResponse) UnmarshalJSON

func (r *ProfileLookupResponse) UnmarshalJSON(data []byte) error

type ProfileLookupResponseNotFound

type ProfileLookupResponseNotFound struct {
	// Social media platform
	//
	// Any of "instagram".
	Platform string `json:"platform" api:"required"`
	Username string `json:"username" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Platform    respjson.Field
		Username    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProfileLookupResponseNotFound) RawJSON

Returns the unmodified JSON received from the API

func (*ProfileLookupResponseNotFound) UnmarshalJSON

func (r *ProfileLookupResponseNotFound) UnmarshalJSON(data []byte) error

type ProfileMetrics

type ProfileMetrics struct {
	// Average comments on recent posts
	AvgCommentsRecent float64 `json:"avg_comments_recent" api:"required"`
	// Average likes on recent posts
	AvgLikesRecent float64 `json:"avg_likes_recent" api:"required"`
	// Average views on recent posts (for video content)
	AvgViewsRecent float64 `json:"avg_views_recent" api:"required"`
	// Engagement rate as a percentage (e.g. 3.5 means 3.5%)
	EngagementRate float64 `json:"engagement_rate" api:"required"`
	// Follower count
	Followers int64 `json:"followers" api:"required"`
	// Following count
	Following int64 `json:"following" api:"required"`
	// Total post count
	Posts int64 `json:"posts" api:"required"`
	// Posts in the last 30 days
	PostsLast30d int64 `json:"posts_last_30d" api:"required"`
	// Average posts per week
	PostsPerWeek float64 `json:"posts_per_week" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AvgCommentsRecent respjson.Field
		AvgLikesRecent    respjson.Field
		AvgViewsRecent    respjson.Field
		EngagementRate    respjson.Field
		Followers         respjson.Field
		Following         respjson.Field
		Posts             respjson.Field
		PostsLast30d      respjson.Field
		PostsPerWeek      respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Profile performance metrics

func (ProfileMetrics) RawJSON

func (r ProfileMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileMetrics) UnmarshalJSON

func (r *ProfileMetrics) UnmarshalJSON(data []byte) error

type ProfileResponseData

type ProfileResponseData struct {
	// Profile unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// Profile activity information
	Activity ProfileActivity `json:"activity" api:"required"`
	// Avatar URL
	AvatarURL string `json:"avatar_url" api:"required" format:"uri"`
	// Profile bio
	Bio string `json:"bio" api:"required"`
	// Account category
	Category string `json:"category" api:"required"`
	// Creator unique identifier
	CreatorID string `json:"creator_id" api:"required" format:"uuid"`
	// Last data refresh timestamp
	DataUpdatedAt time.Time `json:"data_updated_at" api:"required" format:"date-time"`
	// Display name
	DisplayName string `json:"display_name" api:"required"`
	// External website URL from bio
	ExternalURL string `json:"external_url" api:"required" format:"uri"`
	// Profile growth statistics
	Growth ProfileGrowth `json:"growth" api:"required"`
	// Whether this is a business account
	IsBusiness bool `json:"is_business" api:"required"`
	// Whether the account is private
	IsPrivate bool `json:"is_private" api:"required"`
	// Whether the account is verified
	IsVerified bool `json:"is_verified" api:"required"`
	// Profile performance metrics
	Metrics ProfileMetrics `json:"metrics" api:"required"`
	// Social media platform
	//
	// Any of "instagram".
	Platform ProfileResponseDataPlatform `json:"platform" api:"required"`
	// Listed pronouns
	Pronouns []string `json:"pronouns" api:"required"`
	// Profile URL
	URL string `json:"url" api:"required" format:"uri"`
	// Profile username
	Username string `json:"username" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Activity      respjson.Field
		AvatarURL     respjson.Field
		Bio           respjson.Field
		Category      respjson.Field
		CreatorID     respjson.Field
		DataUpdatedAt respjson.Field
		DisplayName   respjson.Field
		ExternalURL   respjson.Field
		Growth        respjson.Field
		IsBusiness    respjson.Field
		IsPrivate     respjson.Field
		IsVerified    respjson.Field
		Metrics       respjson.Field
		Platform      respjson.Field
		Pronouns      respjson.Field
		URL           respjson.Field
		Username      respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Full profile details

func (ProfileResponseData) RawJSON

func (r ProfileResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProfileResponseData) UnmarshalJSON

func (r *ProfileResponseData) UnmarshalJSON(data []byte) error

type ProfileResponseDataPlatform

type ProfileResponseDataPlatform string

Social media platform

const (
	ProfileResponseDataPlatformInstagram ProfileResponseDataPlatform = "instagram"
)

type ProfileService

type ProfileService struct {
	// contains filtered or unexported fields
}

Access individual social media profiles with detailed metrics, growth data, and activity information. Profiles are platform-specific accounts linked to creators.

ProfileService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProfileService method instead.

func NewProfileService

func NewProfileService(opts ...option.RequestOption) (r ProfileService)

NewProfileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProfileService) Get

func (r *ProfileService) Get(ctx context.Context, username string, query ProfileGetParams, opts ...option.RequestOption) (res *ProfileGetResponse, err error)

Retrieve detailed profile data including metrics, growth statistics, and activity information from our database.

**Response includes:**

- Basic info (bio, avatar, verification status) - Performance metrics (followers, engagement rate, avg likes/comments) - Growth data (30-day follower growth, monthly rate) - Activity data (last post date, posting frequency)

**Pricing**: 0.1 credits per request ($0.001)

func (*ProfileService) Lookup

Look up multiple profiles in a single request. Efficiently retrieve data for up to 100 profiles at once.

**Response includes:**

  • `found`: Array of profiles that exist in our database
  • `not_found`: Array of profiles that weren't found (consider live scraping these)

**Pricing**: 0.1 credits per profile ($0.001)

type ProfileSummary

type ProfileSummary = shared.ProfileSummary

Abbreviated profile information

This is an alias to an internal type.

type ProfileSummaryPlatform

type ProfileSummaryPlatform = shared.ProfileSummaryPlatform

Social media platform

This is an alias to an internal type.

type RawInstagramGetProfileParams

type RawInstagramGetProfileParams struct {
	// Include recent posts in response
	IncludePosts param.Opt[bool] `query:"include_posts,omitzero" json:"-"`
	// Number of posts to include
	PostLimit param.Opt[int64] `query:"post_limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (RawInstagramGetProfileParams) URLQuery

func (r RawInstagramGetProfileParams) URLQuery() (v url.Values, err error)

URLQuery serializes RawInstagramGetProfileParams's query parameters as `url.Values`.

type RawInstagramGetProfileResponse

type RawInstagramGetProfileResponse struct {
	// Live scraped profile data
	Data RawInstagramGetProfileResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawInstagramGetProfileResponse) RawJSON

Returns the unmodified JSON received from the API

func (*RawInstagramGetProfileResponse) UnmarshalJSON

func (r *RawInstagramGetProfileResponse) UnmarshalJSON(data []byte) error

type RawInstagramGetProfileResponseData

type RawInstagramGetProfileResponseData struct {
	// Profile unique identifier
	ID       string                                     `json:"id" api:"required" format:"uuid"`
	Activity RawInstagramGetProfileResponseDataActivity `json:"activity" api:"required"`
	// Avatar URL
	AvatarURL string `json:"avatar_url" api:"required" format:"uri"`
	// Profile bio
	Bio string `json:"bio" api:"required"`
	// Account category
	Category string `json:"category" api:"required"`
	// Creator unique identifier
	CreatorID string `json:"creator_id" api:"required" format:"uuid"`
	// Last data refresh timestamp
	DataUpdatedAt time.Time `json:"data_updated_at" api:"required" format:"date-time"`
	// Display name
	DisplayName string `json:"display_name" api:"required"`
	// External website URL
	ExternalURL string                                   `json:"external_url" api:"required" format:"uri"`
	Growth      RawInstagramGetProfileResponseDataGrowth `json:"growth" api:"required"`
	// Whether this is a business account
	IsBusiness bool `json:"is_business" api:"required"`
	// Whether the account is private
	IsPrivate bool `json:"is_private" api:"required"`
	// Whether the account is verified
	IsVerified bool                                      `json:"is_verified" api:"required"`
	Metrics    RawInstagramGetProfileResponseDataMetrics `json:"metrics" api:"required"`
	// Social media platform
	//
	// Any of "instagram".
	Platform string `json:"platform" api:"required"`
	// Listed pronouns
	Pronouns []string `json:"pronouns" api:"required"`
	// When this data was scraped
	ScrapedAt time.Time `json:"scraped_at" api:"required" format:"date-time"`
	// Profile URL
	URL string `json:"url" api:"required" format:"uri"`
	// Profile username
	Username string `json:"username" api:"required"`
	// Recent posts (only included when include_posts=true)
	Posts []RawInstagramGetProfileResponseDataPost `json:"posts"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Activity      respjson.Field
		AvatarURL     respjson.Field
		Bio           respjson.Field
		Category      respjson.Field
		CreatorID     respjson.Field
		DataUpdatedAt respjson.Field
		DisplayName   respjson.Field
		ExternalURL   respjson.Field
		Growth        respjson.Field
		IsBusiness    respjson.Field
		IsPrivate     respjson.Field
		IsVerified    respjson.Field
		Metrics       respjson.Field
		Platform      respjson.Field
		Pronouns      respjson.Field
		ScrapedAt     respjson.Field
		URL           respjson.Field
		Username      respjson.Field
		Posts         respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Live scraped profile data

func (RawInstagramGetProfileResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*RawInstagramGetProfileResponseData) UnmarshalJSON

func (r *RawInstagramGetProfileResponseData) UnmarshalJSON(data []byte) error

type RawInstagramGetProfileResponseDataActivity

type RawInstagramGetProfileResponseDataActivity struct {
	// Timestamp of last post
	LastPostAt time.Time `json:"last_post_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		LastPostAt  respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawInstagramGetProfileResponseDataActivity) RawJSON

Returns the unmodified JSON received from the API

func (*RawInstagramGetProfileResponseDataActivity) UnmarshalJSON

func (r *RawInstagramGetProfileResponseDataActivity) UnmarshalJSON(data []byte) error

type RawInstagramGetProfileResponseDataGrowth

type RawInstagramGetProfileResponseDataGrowth struct {
	// Follower growth percentage over 30 days (e.g. 2.5 means +2.5%)
	Followers30dPct float64 `json:"followers_30d_pct" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Followers30dPct respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawInstagramGetProfileResponseDataGrowth) RawJSON

Returns the unmodified JSON received from the API

func (*RawInstagramGetProfileResponseDataGrowth) UnmarshalJSON

func (r *RawInstagramGetProfileResponseDataGrowth) UnmarshalJSON(data []byte) error

type RawInstagramGetProfileResponseDataMetrics

type RawInstagramGetProfileResponseDataMetrics struct {
	// Average comments on recent posts
	AvgCommentsRecent float64 `json:"avg_comments_recent" api:"required"`
	// Average likes on recent posts
	AvgLikesRecent float64 `json:"avg_likes_recent" api:"required"`
	// Average views on recent posts
	AvgViewsRecent float64 `json:"avg_views_recent" api:"required"`
	// Engagement rate as a percentage (e.g. 3.5 means 3.5%)
	EngagementRate float64 `json:"engagement_rate" api:"required"`
	// Follower count
	Followers int64 `json:"followers" api:"required"`
	// Following count
	Following int64 `json:"following" api:"required"`
	// Total post count
	Posts int64 `json:"posts" api:"required"`
	// Posts in the last 30 days
	PostsLast30d int64 `json:"posts_last_30d" api:"required"`
	// Average posts per week
	PostsPerWeek float64 `json:"posts_per_week" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AvgCommentsRecent respjson.Field
		AvgLikesRecent    respjson.Field
		AvgViewsRecent    respjson.Field
		EngagementRate    respjson.Field
		Followers         respjson.Field
		Following         respjson.Field
		Posts             respjson.Field
		PostsLast30d      respjson.Field
		PostsPerWeek      respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawInstagramGetProfileResponseDataMetrics) RawJSON

Returns the unmodified JSON received from the API

func (*RawInstagramGetProfileResponseDataMetrics) UnmarshalJSON

func (r *RawInstagramGetProfileResponseDataMetrics) UnmarshalJSON(data []byte) error

type RawInstagramGetProfileResponseDataPost

type RawInstagramGetProfileResponseDataPost struct {
	// Post unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// Post caption
	Caption string `json:"caption" api:"required"`
	// Comment count
	CommentsCount int64 `json:"comments_count" api:"required"`
	// Like count
	LikesCount int64 `json:"likes_count" api:"required"`
	// Primary media URL
	MediaURL string `json:"media_url" api:"required" format:"uri"`
	// Platform-specific post ID
	PlatformID string `json:"platform_id" api:"required"`
	// Post timestamp
	PostedAt time.Time `json:"posted_at" api:"required" format:"date-time"`
	// Type of post
	//
	// Any of "image", "video", "carousel", "reel", "story".
	Type string `json:"type" api:"required"`
	// Post URL
	URL string `json:"url" api:"required" format:"uri"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Caption       respjson.Field
		CommentsCount respjson.Field
		LikesCount    respjson.Field
		MediaURL      respjson.Field
		PlatformID    respjson.Field
		PostedAt      respjson.Field
		Type          respjson.Field
		URL           respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Simplified post from live scrape

func (RawInstagramGetProfileResponseDataPost) RawJSON

Returns the unmodified JSON received from the API

func (*RawInstagramGetProfileResponseDataPost) UnmarshalJSON

func (r *RawInstagramGetProfileResponseDataPost) UnmarshalJSON(data []byte) error

type RawInstagramService

type RawInstagramService struct {
	// contains filtered or unexported fields
}

Fetch fresh data directly from social platforms in real-time. Use when you need the most current information or data for profiles not yet in our database.

RawInstagramService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRawInstagramService method instead.

func NewRawInstagramService

func NewRawInstagramService(opts ...option.RequestOption) (r RawInstagramService)

NewRawInstagramService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RawInstagramService) GetProfile

Fetch fresh Instagram profile data directly from Instagram in real-time. Use this when you need the most current follower counts, bio, or recent activity.

**When to use live scraping:**

- Profile not found in our database - Need real-time follower/engagement data - Verifying current profile status before campaign

**Note:** Live scraping is slower than cached data (2-5 seconds) and costs more. Use cached endpoints when freshness isn't critical.

**Pricing**: 0.5 credits per profile scraped ($0.005)

type RawService

type RawService struct {

	// Fetch fresh data directly from social platforms in real-time. Use when you need
	// the most current information or data for profiles not yet in our database.
	Instagram RawInstagramService
	// Fetch fresh data directly from social platforms in real-time. Use when you need
	// the most current information or data for profiles not yet in our database.
	Youtube RawYoutubeService
	// contains filtered or unexported fields
}

RawService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRawService method instead.

func NewRawService

func NewRawService(opts ...option.RequestOption) (r RawService)

NewRawService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

type RawYoutubeGetChannelParams

type RawYoutubeGetChannelParams struct {
	// Include recent videos in response
	IncludeVideos param.Opt[bool] `query:"include_videos,omitzero" json:"-"`
	// Number of videos to include
	VideoLimit param.Opt[int64] `query:"video_limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (RawYoutubeGetChannelParams) URLQuery

func (r RawYoutubeGetChannelParams) URLQuery() (v url.Values, err error)

URLQuery serializes RawYoutubeGetChannelParams's query parameters as `url.Values`.

type RawYoutubeGetChannelResponse

type RawYoutubeGetChannelResponse struct {
	Data RawYoutubeGetChannelResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetChannelResponse) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetChannelResponse) UnmarshalJSON

func (r *RawYoutubeGetChannelResponse) UnmarshalJSON(data []byte) error

type RawYoutubeGetChannelResponseData

type RawYoutubeGetChannelResponseData struct {
	// Channel avatar URL
	AvatarURL string `json:"avatar_url" api:"required" format:"uri"`
	// Channel description
	Description string `json:"description" api:"required"`
	// Channel handle
	Handle string `json:"handle" api:"required"`
	// Channel name
	Name string `json:"name" api:"required"`
	// When this data was scraped
	ScrapedAt time.Time `json:"scraped_at" api:"required" format:"date-time"`
	// Subscriber count
	Subscribers int64 `json:"subscribers" api:"required"`
	// Total video count
	VideosCount int64 `json:"videos_count" api:"required"`
	// Total view count
	ViewsTotal int64 `json:"views_total" api:"required"`
	// Recent videos (only included when include_videos=true)
	Videos []RawYoutubeGetChannelResponseDataVideo `json:"videos"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AvatarURL   respjson.Field
		Description respjson.Field
		Handle      respjson.Field
		Name        respjson.Field
		ScrapedAt   respjson.Field
		Subscribers respjson.Field
		VideosCount respjson.Field
		ViewsTotal  respjson.Field
		Videos      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetChannelResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetChannelResponseData) UnmarshalJSON

func (r *RawYoutubeGetChannelResponseData) UnmarshalJSON(data []byte) error

type RawYoutubeGetChannelResponseDataVideo

type RawYoutubeGetChannelResponseDataVideo struct {
	// Video ID
	ID string `json:"id" api:"required"`
	// Comment count
	Comments int64 `json:"comments" api:"required"`
	// Video duration in seconds
	DurationSeconds int64 `json:"duration_seconds" api:"required"`
	// Like count
	Likes int64 `json:"likes" api:"required"`
	// Publish timestamp
	PublishedAt time.Time `json:"published_at" api:"required" format:"date-time"`
	// Thumbnail URL
	ThumbnailURL string `json:"thumbnail_url" api:"required" format:"uri"`
	// Video title
	Title string `json:"title" api:"required"`
	// Video URL
	URL string `json:"url" api:"required" format:"uri"`
	// View count
	Views int64 `json:"views" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		Comments        respjson.Field
		DurationSeconds respjson.Field
		Likes           respjson.Field
		PublishedAt     respjson.Field
		ThumbnailURL    respjson.Field
		Title           respjson.Field
		URL             respjson.Field
		Views           respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetChannelResponseDataVideo) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetChannelResponseDataVideo) UnmarshalJSON

func (r *RawYoutubeGetChannelResponseDataVideo) UnmarshalJSON(data []byte) error

type RawYoutubeGetChannelTranscriptsParams

type RawYoutubeGetChannelTranscriptsParams struct {
	// Include timestamped transcript segments in response
	IncludeSegments param.Opt[bool] `query:"include_segments,omitzero" json:"-"`
	// Language code for transcripts
	Language param.Opt[string] `query:"language,omitzero" json:"-"`
	// Number of videos to fetch transcripts for (max 20)
	VideoLimit param.Opt[int64] `query:"video_limit,omitzero" json:"-"`
	// How to sort channel videos before selecting
	//
	// Any of "popular", "newest", "oldest".
	SortBy RawYoutubeGetChannelTranscriptsParamsSortBy `query:"sort_by,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (RawYoutubeGetChannelTranscriptsParams) URLQuery

func (r RawYoutubeGetChannelTranscriptsParams) URLQuery() (v url.Values, err error)

URLQuery serializes RawYoutubeGetChannelTranscriptsParams's query parameters as `url.Values`.

type RawYoutubeGetChannelTranscriptsParamsSortBy

type RawYoutubeGetChannelTranscriptsParamsSortBy string

How to sort channel videos before selecting

const (
	RawYoutubeGetChannelTranscriptsParamsSortByPopular RawYoutubeGetChannelTranscriptsParamsSortBy = "popular"
	RawYoutubeGetChannelTranscriptsParamsSortByNewest  RawYoutubeGetChannelTranscriptsParamsSortBy = "newest"
	RawYoutubeGetChannelTranscriptsParamsSortByOldest  RawYoutubeGetChannelTranscriptsParamsSortBy = "oldest"
)

type RawYoutubeGetChannelTranscriptsResponse

type RawYoutubeGetChannelTranscriptsResponse struct {
	Data RawYoutubeGetChannelTranscriptsResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetChannelTranscriptsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetChannelTranscriptsResponse) UnmarshalJSON

func (r *RawYoutubeGetChannelTranscriptsResponse) UnmarshalJSON(data []byte) error

type RawYoutubeGetChannelTranscriptsResponseData

type RawYoutubeGetChannelTranscriptsResponseData struct {
	// YouTube channel ID
	ChannelID string `json:"channel_id" api:"required"`
	// Channel name
	ChannelName string `json:"channel_name" api:"required"`
	// Channel handle
	Handle string `json:"handle" api:"required"`
	// Per-video transcript results
	Items []RawYoutubeGetChannelTranscriptsResponseDataItem `json:"items" api:"required"`
	// When this data was scraped
	ScrapedAt string `json:"scraped_at" api:"required"`
	// Number of transcripts that failed to fetch
	TranscriptsFailed int64 `json:"transcripts_failed" api:"required"`
	// Number of transcripts successfully fetched
	TranscriptsFetched int64 `json:"transcripts_fetched" api:"required"`
	// Total videos found on channel
	VideosFound int64 `json:"videos_found" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChannelID          respjson.Field
		ChannelName        respjson.Field
		Handle             respjson.Field
		Items              respjson.Field
		ScrapedAt          respjson.Field
		TranscriptsFailed  respjson.Field
		TranscriptsFetched respjson.Field
		VideosFound        respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetChannelTranscriptsResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetChannelTranscriptsResponseData) UnmarshalJSON

func (r *RawYoutubeGetChannelTranscriptsResponseData) UnmarshalJSON(data []byte) error

type RawYoutubeGetChannelTranscriptsResponseDataItem

type RawYoutubeGetChannelTranscriptsResponseDataItem struct {
	// Error message if transcript fetch failed for this video
	Error string `json:"error" api:"required"`
	// Full transcript as plain text
	FullText string `json:"full_text" api:"required"`
	// Transcript language code
	Language string `json:"language" api:"required"`
	// Relative publish time
	PublishedText string `json:"published_text" api:"required"`
	// Caption source type
	//
	// Any of "manual", "auto_generated".
	Source string `json:"source" api:"required"`
	// Video title
	Title string `json:"title" api:"required"`
	// Timestamped segments (only if include_segments=true)
	Transcript []TranscriptSegment `json:"transcript" api:"required"`
	// Video URL
	URL string `json:"url" api:"required"`
	// YouTube video ID
	VideoID string `json:"video_id" api:"required"`
	// View count
	ViewCount float64 `json:"view_count" api:"required"`
	// Word count of transcript
	WordCount float64 `json:"word_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Error         respjson.Field
		FullText      respjson.Field
		Language      respjson.Field
		PublishedText respjson.Field
		Source        respjson.Field
		Title         respjson.Field
		Transcript    respjson.Field
		URL           respjson.Field
		VideoID       respjson.Field
		ViewCount     respjson.Field
		WordCount     respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetChannelTranscriptsResponseDataItem) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetChannelTranscriptsResponseDataItem) UnmarshalJSON

type RawYoutubeGetTranscriptParams

type RawYoutubeGetTranscriptParams struct {
	// Language code or "auto" for automatic detection
	Language param.Opt[string] `query:"language,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (RawYoutubeGetTranscriptParams) URLQuery

func (r RawYoutubeGetTranscriptParams) URLQuery() (v url.Values, err error)

URLQuery serializes RawYoutubeGetTranscriptParams's query parameters as `url.Values`.

type RawYoutubeGetTranscriptResponse

type RawYoutubeGetTranscriptResponse struct {
	Data RawYoutubeGetTranscriptResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetTranscriptResponse) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetTranscriptResponse) UnmarshalJSON

func (r *RawYoutubeGetTranscriptResponse) UnmarshalJSON(data []byte) error

type RawYoutubeGetTranscriptResponseData

type RawYoutubeGetTranscriptResponseData struct {
	// Available transcript languages
	AvailableLanguages []string `json:"available_languages" api:"required"`
	// Full transcript as plain text
	FullText string `json:"full_text" api:"required"`
	// Transcript language code
	Language string `json:"language" api:"required"`
	// Video title
	Title string `json:"title" api:"required"`
	// Transcript segments
	Transcript []TranscriptSegment `json:"transcript" api:"required"`
	// Video URL
	URL string `json:"url" api:"required" format:"uri"`
	// Video ID
	VideoID string `json:"video_id" api:"required"`
	// Total word count
	WordCount int64 `json:"word_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AvailableLanguages respjson.Field
		FullText           respjson.Field
		Language           respjson.Field
		Title              respjson.Field
		Transcript         respjson.Field
		URL                respjson.Field
		VideoID            respjson.Field
		WordCount          respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeGetTranscriptResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeGetTranscriptResponseData) UnmarshalJSON

func (r *RawYoutubeGetTranscriptResponseData) UnmarshalJSON(data []byte) error

type RawYoutubeSearchParams

type RawYoutubeSearchParams struct {
	// Search query
	Q string `query:"q" api:"required" json:"-"`
	// Country code for localized results (ISO 3166-1 alpha-2)
	CountryCode param.Opt[string] `query:"country_code,omitzero" json:"-"`
	// Language code for results
	LanguageCode param.Opt[string] `query:"language_code,omitzero" json:"-"`
	// Maximum number of results to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (RawYoutubeSearchParams) URLQuery

func (r RawYoutubeSearchParams) URLQuery() (v url.Values, err error)

URLQuery serializes RawYoutubeSearchParams's query parameters as `url.Values`.

type RawYoutubeSearchResponse

type RawYoutubeSearchResponse struct {
	Data RawYoutubeSearchResponseData `json:"data" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeSearchResponse) RawJSON

func (r RawYoutubeSearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*RawYoutubeSearchResponse) UnmarshalJSON

func (r *RawYoutubeSearchResponse) UnmarshalJSON(data []byte) error

type RawYoutubeSearchResponseData

type RawYoutubeSearchResponseData struct {
	// Estimated total results count
	EstimatedResults float64 `json:"estimated_results" api:"required"`
	// The search query
	Query string `json:"query" api:"required"`
	// Search results (videos and channels)
	Results []RawYoutubeSearchResponseDataResultUnion `json:"results" api:"required"`
	// When this search was performed
	ScrapedAt string `json:"scraped_at" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EstimatedResults respjson.Field
		Query            respjson.Field
		Results          respjson.Field
		ScrapedAt        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeSearchResponseData) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeSearchResponseData) UnmarshalJSON

func (r *RawYoutubeSearchResponseData) UnmarshalJSON(data []byte) error

type RawYoutubeSearchResponseDataResultUnion

type RawYoutubeSearchResponseDataResultUnion struct {
	ChannelHandle   string `json:"channel_handle"`
	ChannelID       string `json:"channel_id"`
	ChannelName     string `json:"channel_name"`
	ChannelVerified bool   `json:"channel_verified"`
	Description     string `json:"description"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	DurationSeconds float64 `json:"duration_seconds"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	DurationText string `json:"duration_text"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	PublishedAt string `json:"published_at"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	PublishedText string `json:"published_text"`
	ThumbnailURL  string `json:"thumbnail_url"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	Title string `json:"title"`
	Type  string `json:"type"`
	URL   string `json:"url"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	VideoID string `json:"video_id"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	ViewCount float64 `json:"view_count"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult].
	ViewCountText string `json:"view_count_text"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult].
	SubscriberCount float64 `json:"subscriber_count"`
	// This field is from variant
	// [RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult].
	VideoCount int64 `json:"video_count"`
	JSON       struct {
		ChannelHandle   respjson.Field
		ChannelID       respjson.Field
		ChannelName     respjson.Field
		ChannelVerified respjson.Field
		Description     respjson.Field
		DurationSeconds respjson.Field
		DurationText    respjson.Field
		PublishedAt     respjson.Field
		PublishedText   respjson.Field
		ThumbnailURL    respjson.Field
		Title           respjson.Field
		Type            respjson.Field
		URL             respjson.Field
		VideoID         respjson.Field
		ViewCount       respjson.Field
		ViewCountText   respjson.Field
		SubscriberCount respjson.Field
		VideoCount      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

RawYoutubeSearchResponseDataResultUnion contains all possible properties and values from RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult, RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (RawYoutubeSearchResponseDataResultUnion) AsRawYoutubeSearchResponseDataResultYouTubeSearchChannelResult

func (u RawYoutubeSearchResponseDataResultUnion) AsRawYoutubeSearchResponseDataResultYouTubeSearchChannelResult() (v RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult)

func (RawYoutubeSearchResponseDataResultUnion) AsRawYoutubeSearchResponseDataResultYouTubeSearchVideoResult

func (u RawYoutubeSearchResponseDataResultUnion) AsRawYoutubeSearchResponseDataResultYouTubeSearchVideoResult() (v RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult)

func (RawYoutubeSearchResponseDataResultUnion) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeSearchResponseDataResultUnion) UnmarshalJSON

func (r *RawYoutubeSearchResponseDataResultUnion) UnmarshalJSON(data []byte) error

type RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult

type RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult struct {
	// Channel handle (e.g., @username)
	ChannelHandle string `json:"channel_handle" api:"required"`
	// Channel ID
	ChannelID string `json:"channel_id" api:"required"`
	// Channel name
	ChannelName string `json:"channel_name" api:"required"`
	// Whether channel is verified
	ChannelVerified bool `json:"channel_verified" api:"required"`
	// Channel description snippet
	Description string `json:"description" api:"required"`
	// Subscriber count
	SubscriberCount float64 `json:"subscriber_count" api:"required"`
	// Channel avatar URL
	ThumbnailURL string           `json:"thumbnail_url" api:"required"`
	Type         constant.Channel `json:"type" api:"required"`
	// Full YouTube channel URL
	URL string `json:"url" api:"required"`
	// Number of videos on the channel
	VideoCount int64 `json:"video_count" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChannelHandle   respjson.Field
		ChannelID       respjson.Field
		ChannelName     respjson.Field
		ChannelVerified respjson.Field
		Description     respjson.Field
		SubscriberCount respjson.Field
		ThumbnailURL    respjson.Field
		Type            respjson.Field
		URL             respjson.Field
		VideoCount      respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeSearchResponseDataResultYouTubeSearchChannelResult) UnmarshalJSON

type RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult

type RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult struct {
	// Channel handle (e.g., @username)
	ChannelHandle string `json:"channel_handle" api:"required"`
	// Channel ID
	ChannelID string `json:"channel_id" api:"required"`
	// Channel name
	ChannelName string `json:"channel_name" api:"required"`
	// Whether channel is verified
	ChannelVerified bool `json:"channel_verified" api:"required"`
	// Video description snippet
	Description string `json:"description" api:"required"`
	// Video duration in seconds
	DurationSeconds float64 `json:"duration_seconds" api:"required"`
	// Video duration text (e.g., "12:34")
	DurationText string `json:"duration_text" api:"required"`
	// Approximate publish timestamp
	PublishedAt string `json:"published_at" api:"required"`
	// Relative publish time (e.g., "2 days ago")
	PublishedText string `json:"published_text" api:"required"`
	// Video thumbnail URL
	ThumbnailURL string `json:"thumbnail_url" api:"required"`
	// Video title
	Title string         `json:"title" api:"required"`
	Type  constant.Video `json:"type" api:"required"`
	// Full YouTube video URL
	URL string `json:"url" api:"required"`
	// YouTube video ID
	VideoID string `json:"video_id" api:"required"`
	// Number of views
	ViewCount float64 `json:"view_count" api:"required"`
	// View count text (e.g., "1.2M views")
	ViewCountText string `json:"view_count_text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ChannelHandle   respjson.Field
		ChannelID       respjson.Field
		ChannelName     respjson.Field
		ChannelVerified respjson.Field
		Description     respjson.Field
		DurationSeconds respjson.Field
		DurationText    respjson.Field
		PublishedAt     respjson.Field
		PublishedText   respjson.Field
		ThumbnailURL    respjson.Field
		Title           respjson.Field
		Type            respjson.Field
		URL             respjson.Field
		VideoID         respjson.Field
		ViewCount       respjson.Field
		ViewCountText   respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult) RawJSON

Returns the unmodified JSON received from the API

func (*RawYoutubeSearchResponseDataResultYouTubeSearchVideoResult) UnmarshalJSON

type RawYoutubeService

type RawYoutubeService struct {
	// contains filtered or unexported fields
}

Fetch fresh data directly from social platforms in real-time. Use when you need the most current information or data for profiles not yet in our database.

RawYoutubeService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewRawYoutubeService method instead.

func NewRawYoutubeService

func NewRawYoutubeService(opts ...option.RequestOption) (r RawYoutubeService)

NewRawYoutubeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*RawYoutubeService) GetChannel

Fetch fresh YouTube channel data including subscriber count, video count, and total views.

**Pricing**: 0.5 credits per channel scraped ($0.005)

func (*RawYoutubeService) GetChannelTranscripts

Fetch transcripts for multiple videos from a YouTube channel. Videos can be sorted by popularity, newest, or oldest before selection.

**Features:**

- Fetches up to 20 video transcripts per request - Sort by popular (most views), newest, or oldest - Partial success — individual video failures don't block the response - Optional timestamped segments for each transcript

**Pricing**: 0.5 credits per transcript fetched ($0.005)

func (*RawYoutubeService) GetTranscript

Fetch YouTube video transcript/captions. Returns timestamped segments and full text. Useful for content analysis.

**Supported sources:**

- Manual captions (highest quality) - Auto-generated captions - Multiple language tracks

**Pricing**: 0.5 credits per transcript ($0.005)

func (*RawYoutubeService) Search

Search YouTube videos and channels.

**Pricing**: 0.5 credits per result returned ($0.005)

type SearchGetParams

type SearchGetParams struct {
	// Pagination cursor for next page
	Cursor param.Opt[string] `query:"cursor,omitzero" json:"-"`
	// Maximum results to return
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (SearchGetParams) URLQuery

func (r SearchGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes SearchGetParams's query parameters as `url.Values`.

type SearchGetResponse

type SearchGetResponse struct {
	// Basic creator information
	Creator shared.CreatorBasic `json:"creator" api:"required"`
	// Search match information
	Match MatchInfo `json:"match" api:"required"`
	// Abbreviated profile information
	PrimaryProfile shared.ProfileSummary `json:"primary_profile" api:"required"`
	// Abbreviated profile information
	RelevantProfile shared.ProfileSummary `json:"relevant_profile" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Creator         respjson.Field
		Match           respjson.Field
		PrimaryProfile  respjson.Field
		RelevantProfile respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SearchGetResponse) RawJSON

func (r SearchGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SearchGetResponse) UnmarshalJSON

func (r *SearchGetResponse) UnmarshalJSON(data []byte) error

type SearchNewParams

type SearchNewParams struct {
	// Natural language search query
	Query string `json:"query" api:"required"`
	// Maximum results to return
	Limit param.Opt[int64] `json:"limit,omitzero"`
	// Additional filters
	Filters SearchNewParamsFilters `json:"filters,omitzero"`
	// Filter results to specific platforms
	//
	// Any of "instagram".
	Platforms []string `json:"platforms,omitzero"`
	// contains filtered or unexported fields
}

func (SearchNewParams) MarshalJSON

func (r SearchNewParams) MarshalJSON() (data []byte, err error)

func (*SearchNewParams) UnmarshalJSON

func (r *SearchNewParams) UnmarshalJSON(data []byte) error

type SearchNewParamsFilters

type SearchNewParamsFilters struct {
	// Filter by verified status
	Verified param.Opt[bool] `json:"verified,omitzero"`
	// Filter by engagement rate
	EngagementRate SearchNewParamsFiltersEngagementRate `json:"engagement_rate,omitzero"`
	// Filter by follower count
	Followers SearchNewParamsFiltersFollowers `json:"followers,omitzero"`
	// contains filtered or unexported fields
}

Additional filters

func (SearchNewParamsFilters) MarshalJSON

func (r SearchNewParamsFilters) MarshalJSON() (data []byte, err error)

func (*SearchNewParamsFilters) UnmarshalJSON

func (r *SearchNewParamsFilters) UnmarshalJSON(data []byte) error

type SearchNewParamsFiltersEngagementRate

type SearchNewParamsFiltersEngagementRate struct {
	// Maximum engagement rate (%)
	Max param.Opt[float64] `json:"max,omitzero"`
	// Minimum engagement rate (%)
	Min param.Opt[float64] `json:"min,omitzero"`
	// contains filtered or unexported fields
}

Filter by engagement rate

func (SearchNewParamsFiltersEngagementRate) MarshalJSON

func (r SearchNewParamsFiltersEngagementRate) MarshalJSON() (data []byte, err error)

func (*SearchNewParamsFiltersEngagementRate) UnmarshalJSON

func (r *SearchNewParamsFiltersEngagementRate) UnmarshalJSON(data []byte) error

type SearchNewParamsFiltersFollowers

type SearchNewParamsFiltersFollowers struct {
	// Maximum follower count
	Max param.Opt[float64] `json:"max,omitzero"`
	// Minimum follower count
	Min param.Opt[float64] `json:"min,omitzero"`
	// contains filtered or unexported fields
}

Filter by follower count

func (SearchNewParamsFiltersFollowers) MarshalJSON

func (r SearchNewParamsFiltersFollowers) MarshalJSON() (data []byte, err error)

func (*SearchNewParamsFiltersFollowers) UnmarshalJSON

func (r *SearchNewParamsFiltersFollowers) UnmarshalJSON(data []byte) error

type SearchNewResponse

type SearchNewResponse struct {
	Data []SearchNewResponseData `json:"data" api:"required"`
	// Whether more results are available
	HasMore bool `json:"has_more" api:"required"`
	// Cursor for the next page
	NextCursor string `json:"next_cursor" api:"required"`
	// Search ID. Use with GET /v1/search/{id} for free pagination.
	SearchID string `json:"search_id" api:"required" format:"uuid"`
	// Total number of results across all pages
	Total int64 `json:"total" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		HasMore     respjson.Field
		NextCursor  respjson.Field
		SearchID    respjson.Field
		Total       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SearchNewResponse) RawJSON

func (r SearchNewResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SearchNewResponse) UnmarshalJSON

func (r *SearchNewResponse) UnmarshalJSON(data []byte) error

type SearchNewResponseData

type SearchNewResponseData struct {
	// Basic creator information
	Creator shared.CreatorBasic `json:"creator" api:"required"`
	// Search match information
	Match MatchInfo `json:"match" api:"required"`
	// Abbreviated profile information
	PrimaryProfile shared.ProfileSummary `json:"primary_profile" api:"required"`
	// Abbreviated profile information
	RelevantProfile shared.ProfileSummary `json:"relevant_profile" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Creator         respjson.Field
		Match           respjson.Field
		PrimaryProfile  respjson.Field
		RelevantProfile respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (SearchNewResponseData) RawJSON

func (r SearchNewResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*SearchNewResponseData) UnmarshalJSON

func (r *SearchNewResponseData) UnmarshalJSON(data []byte) error

type SearchService

type SearchService struct {
	// contains filtered or unexported fields
}

AI-powered semantic search to find creators using natural language queries. Understands intent and context to match creators based on content themes, audience, and style.

SearchService contains methods and other services that help with interacting with the Influship API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewSearchService method instead.

func NewSearchService

func NewSearchService(opts ...option.RequestOption) (r SearchService)

NewSearchService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*SearchService) Get

Paginate through results from a previous search. Use the `search_id` returned by `POST /v1/search` to fetch additional pages.

Search sessions expire after 1 hour. After expiry, a new search must be run.

**Pricing**: 0 credits (included with initial search)

func (*SearchService) GetAutoPaging

Paginate through results from a previous search. Use the `search_id` returned by `POST /v1/search` to fetch additional pages.

Search sessions expire after 1 hour. After expiry, a new search must be run.

**Pricing**: 0 credits (included with initial search)

func (*SearchService) New

Search for creators using natural language queries. The AI understands intent and context to match creators based on content themes, audience demographics, and style.

The response includes a `search_id` that can be used with `GET /v1/search/{id}` to paginate through results for free.

**Use cases:**

  • Find creators in a specific niche ("vegan food bloggers in LA")
  • Discover creators with specific audience characteristics ("fitness influencers with millennial audience")
  • Search by content style ("creators who post cinematic travel videos")

**Pricing**: 25 credits base + 2 credits per creator returned

type TranscriptSegment

type TranscriptSegment struct {
	// Duration in seconds
	Duration float64 `json:"duration" api:"required"`
	// Start time in seconds
	Start float64 `json:"start" api:"required"`
	// Segment text
	Text string `json:"text" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Duration    respjson.Field
		Start       respjson.Field
		Text        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TranscriptSegment) RawJSON

func (r TranscriptSegment) RawJSON() string

Returns the unmodified JSON received from the API

func (*TranscriptSegment) UnmarshalJSON

func (r *TranscriptSegment) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL