REPUSTATE-IQ

REPUSTATE-IQ

Get list of existing projects for this API key

Return a list of project IDs for the given API key

SecurityApiKeyAuth
Responses
200

List existing projects

get/api/project/
Response samples
application/json
{
  • "projects": [
    ]
}

Create a new project in Repustate IQ

This creates a new project in Repustate IQ and makes it available for adding new data immediately

SecurityApiKeyAuth
Request
Request Body schema: multipart/form-data
name
required
string

The name of the new project

username
required
string

Your Repustate IQ username (email address)

aspect_model
string

The aspect sentiment model to associate with this project. The model must already exist.

Responses
201

Numeric ID of newly created project

post/api/project/
Request samples
curl -H "x-api-key: $apikey" -d "name=My Project&aspect_model=hotel&username=user@example.com" https://iq.repustate.com/api/project/
Response samples
application/json
{
  • "project_id": 2345
}

Get existing data from project

Return JSON serialized objects representing data items added to this project

SecurityApiKeyAuth
Request
path Parameters
project_id
required
integer

Numeric project ID

query Parameters
search
string

Free text search of the content in your project. Boolean operators (AND, NOT, OR) are supported.

external_id
string

External ID originally set when adding new data item

date_from
string

The earliest date to retrieve data from. YYYY-MM-DD format

date_to
string

The latest date to retrieve data until. YYYY-MM-DD format

sources
string

A comma separated list of source names you want to filter by

sentiment
string

The sentiment of the comment or video

Enum: "positive" "negative" "neutral"
author
string

The username of the user who created the content

url
string <uri>

The URL for the data item. Matching is done as a prefix match so if you supply the URL to a video, the video and all of its comments will be returned

metadata_key
string

A single metadata key you want to filter data on. Data items that have this key, regardless of value, will be returned.

metadata
string

A valid JSON string containing 1 or more key/value pairs to be queried against. If multiple key/value pairs are included, this is the equivalent of an "and" operation and a Data item must contain all keys specified and all values must be present as well. If the metadata values are numerical in type, you can include comparison operators in your query. For example, if the metadata key is likes you can use '{"likes__gt": 100}' as your query to find all Data items who have more than 100 likes.

page
integer

The page offset to retrieve data from when paginating through results

page_size
integer

The number of data items to return per page. Default is 10. Maximum is 100.

sort
string

The sort order for the results. The default is by date created, newest to oldest. Other options for sorting are by sentiment or by metadata where you supply which metadata key you'd like to sort by prefixed by metadata__. For example, if you wanted to sort by likes, specify sort=metadata__likes.

Responses
200

OK

get/api/data/{project_id}/
Request samples
curl -H "x-api-key: $apikey" https://iq.repustate.com/api/data/{project_id}/?metadata_key=rating
Response samples
application/json
{
  • "total": 1592,
  • "data": [
    ]
}

Delete existing data from project

Delete Data items from a project. Careful, this operation cannot be undone.

SecurityApiKeyAuth
Request
path Parameters
project_id
required
integer

Numeric project ID

query Parameters
date_from
string

The earliest date to retrieve data from. YYYY-MM-DD format

date_to
string

The latest date to retrieve data until. YYYY-MM-DD format

sources
string

A comma separated list of source names you want to filter by

metadata_key
string

A single metadata key you want to filter data on. Data items that have this key, regardless of value, will be deleted.

metadata
string

A valid JSON string containing 1 or more key/value pairs to be queried against. If multiple key/value pairs are included, this is the equivalent of an "and" operation and a Data item must contain all keys specified and all values must be present as well.

Responses
200

OK

delete/api/data/{project_id}/
Response samples
application/json
{
  • "total": 1592
}

Add data to an existing project

Add a new data item to an existing project. Data will be added to a queue and analyzed in order they are received. The immediate response value is the task ID for this request. If your project is setup to have a webhook, this task ID will be in the request body of the webhook.

Request
path Parameters
project_id
required
integer

Numeric project ID

Request Body schema: multipart/form-data
text
required
string

The text you want to analyze

lang
string

The language of the text you're analyze. If omitted, Repustate will automatically determine the language

external_id
string

Any string representing an external ID or reference. You can also fetch data by this data after added.

source
required
string

Name of data source for this data item

url
string

The URL this data item can be found at

date
string

The date this data item was published or created. YYYY-MM-DD format.

metadata
string

Additional metadata to store along with text. Keys will be searchable via API and Repustate IQ dashboard. Must be a valid JSON string in key-value pair format

Responses
201

Created

post/api/data/{project_id}/
Request samples
curl -H "x-api-key: $apikey" -d "text=my news story&lang=en&source=nytimes.com&url=nytimes.com/my-story" https://iq.repustate.com/api/data/{project_id}/
Response samples
application/json
{
  • "task_id": "2519ade0-1d78-11ec-9621-0242ac130002"
}

Get metadata keys (or values)

Return list of possible metadata keys. If a specific key is supplied, return the values for that key

SecurityApiKeyAuth
Request
path Parameters
project_id
required
integer

Numeric project ID

query Parameters
key
string

The specific metadata key you want to retrive values for

Responses
200

OK

get/api/metadata/{project_id}/
Response samples
application/json
{
  • "keys": [
    ]
}

Fetch news, reviews and social media

Retrieve news, reviews or social media data from the specified data source

SecurityApiKeyAuth
Request
path Parameters
project_id
required
integer

Numeric project ID

Request Body schema: application/json
search
required
string

The query parameter on which to fetch data from the requested source. Depending on the source, the required search value differs:

amazon: a URL for the product you want to analyze

douyin: a keyword search

glassdoor: the URL for the company's profile

google-maps-review: a keyword search for a product, location or place of interest

instagram: either a hashtag, URL to a specific post or a @username for a particular user

news: a keyword search with boolean operators (ANd, OR, NOT) supported

opentable: the URL for the restaurant's profile

podcasts: a keyword search

reddit: a keyword search as well as boolean operators (AND, OR, NOT)

tiktok: either a hashtag, URL to a specific post or a @username for a particular user

twitter: a keyword search as well as any operators that Twitter supports

yelp: the URL for the business' profile

youtube: either a keyword search, URL to a specific video or the URL to a channel or playlist

source
required
string

The data source you want to fetch data from. Possible values are: amazon, douyin, glassdoor, google-maps-review, instagram, news, opentable, podcasts, reddit, reddit and tiktok, twitter, youtube and yelp

doCreateSchedule
boolean

Set this value to 1 if you want to repeatedly request this data source, adding only new data each time.

scheduleFrequency
integer

A number indicating how often you'd like to repeate the scheduled retrieval of this data source. Must be used in combination with schedulePeriod

schedulePeriod
string

The units for the scheduleFrequency. Possible values are days or weeks.

scheduleDatetime
string

The date you'd like the schedule begin. Must be at least today's date. Format must be YYYY-MM-DDTHH:MM+0000 where YYYY is the year, MM is the two digit month, DD is the two digit day, HH is the two digit hour (24 hour time), MM is the two digit minutes. All times are relative to GMT time.

limit
number

The maximum number of matching data points you want to fetch.

since
string <date>

The earliest date you want to begin fetching data from.

Responses
201

Request created

400

Fail (missing arguments)

post/api/project/{project_id}/data-request/
Request samples
application/json
{
  • "search": "string",
  • "source": "string",
  • "doCreateSchedule": true,
  • "scheduleFrequency": 0,
  • "schedulePeriod": "string",
  • "scheduleDatetime": "string",
  • "limit": 0,
  • "since": "2019-08-24"
}
Response samples
application/json
{
  • "request_id": "266ea41d-adf5-480b-af50-15b940c2b846",
  • "status": "OK"
}

Check the status of an existing data request

Check the status of an existing data request

SecurityApiKeyAuth
Request
path Parameters
request_id
required
string <uuid>

Request ID of data request you want to check

Responses
200

Data request status

400

Fail (missing arguments)

get/api/data-request/{request_id}/
Request samples
curl -H "x-api-key: $apikey" https://iq.repustate.com/api/data-request/{request_id}/
Response samples
application/json
{
  • "created": "2019-08-24T14:15:22Z",
  • "limit": 0,
  • "project": "string",
  • "since": "2019-08-24",
  • "summary": "string",
  • "status": "QUEUED"
}