### DictionaryEntry data example Source: https://www.textrazor.com/docs/rest Example of the data dictionary mapping string keys to lists of string values for application-specific metadata. ```json {'type':['people', 'person', 'politician']} ``` -------------------------------- ### GET /entities/ Source: https://www.textrazor.com/docs/rest Returns a list of all dictionaries in your account. ```APIDOC ## GET /entities/ ### Description Returns a list of all Dictionary in your account. ### Method GET ### Endpoint /entities/ ``` -------------------------------- ### GET /account/ Source: https://www.textrazor.com/docs/rest Retrieves account information and usage data. ```APIDOC ## GET /account/ ### Description Returns a complete Account object containing usage and account details. ### Method GET ### Endpoint https://api.textrazor.com/account/ ``` -------------------------------- ### Category object structure Source: https://www.textrazor.com/docs/rest Example of the JSON structure for a Category object. ```json { "categoryId" : "100", "label" : "Golf", "query" : "concept('sport>golf')" } ``` -------------------------------- ### Perform API Request with cURL Source: https://www.textrazor.com/docs/rest Example of a POST request to the TextRazor API including authentication headers and extraction parameters. ```bash curl -X POST \ -H "x-textrazor-key: YOUR_API_KEY" \ -d "extractors=entities,entailments" \ -d "text=Spain's stricken Bankia expects to sell off its vast portfolio of industrial holdings that includes a stake in the parent company of British Airways and Iberia." \ https://api.textrazor.com/ ``` -------------------------------- ### GET /entities/{DICTIONARY_ID}/{ENTITY_ID} Source: https://www.textrazor.com/docs/rest Gets a specific entity by id. ```APIDOC ## GET /entities/{DICTIONARY_ID}/{ENTITY_ID} ### Description Gets a specific entity by id. ### Method GET ### Endpoint /entities/{DICTIONARY_ID}/{ENTITY_ID} ### Parameters #### Path Parameters - **DICTIONARY_ID** (string) - Required - The unique identifier for the dictionary. - **ENTITY_ID** (string) - Required - The unique identifier for the entity. ``` -------------------------------- ### Get a dictionary by ID Source: https://www.textrazor.com/docs/rest Returns a specific Dictionary object by its ID. ```bash curl -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/entities/test_ents ``` -------------------------------- ### Example Entity Object JSON Source: https://www.textrazor.com/docs/rest A sample representation of an Entity object showing common fields like positions, identifiers, and Wikidata types. ```json { "startingPos": 10, "endingPos": 25, "wikidataTypes": ["Q43229/organization"], "crunchbaseId": "example-company", "lei": "LEGAL_ENTITY_IDENTIFIER", "figi": "OPENFIGI_IDENTIFIER", "permid": "PERMID_IDENTIFIER" } ``` -------------------------------- ### GET /entities/{DICTIONARY_ID} Source: https://www.textrazor.com/docs/rest Returns a Dictionary object by id. ```APIDOC ## GET /entities/{DICTIONARY_ID} ### Description Returns a Dictionary object by id. ### Method GET ### Endpoint /entities/{DICTIONARY_ID} ### Parameters #### Path Parameters - **DICTIONARY_ID** (string) - Required - The unique identifier for the dictionary. ``` -------------------------------- ### Perform TextRazor Analysis via cURL Source: https://www.textrazor.com/docs/rest Example of a POST request to the TextRazor API including extractors, address place inclusion, and cleanup settings. ```bash curl -X POST \ -H "x-textrazor-key: YOUR_API_KEY" \ -d "extractors=entities" \ -d "entities.includeAddressPlaces=true" \ -d "url=https://example.com/article" \ -d "cleanup.cleanHTML.precision=3" \ -d "cleanup.cleanHTML.useTitle=true" \ -d "download.runJavascript=true" \ https://api.textrazor.com/ ``` -------------------------------- ### Get a specific dictionary entry Source: https://www.textrazor.com/docs/rest Retrieves a specific entity from a dictionary by its ID. ```bash curl -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/entities/test_ents/DEV2 ``` -------------------------------- ### GET /entities/{DICTIONARY_ID}/_all Source: https://www.textrazor.com/docs/rest Returns all entities in this dictionary, along with paging information. ```APIDOC ## GET /entities/{DICTIONARY_ID}/_all ### Description Returns all entities in this dictionary, along with paging information. ### Method GET ### Endpoint /entities/{DICTIONARY_ID}/_all ### Parameters #### Path Parameters - **DICTIONARY_ID** (string) - Required - The unique identifier for the dictionary. #### Query Parameters - **limit** (integer) - Optional - Number of entities to return. - **offset** (integer) - Optional - Number of entities to skip. ``` -------------------------------- ### GET /categories/{DICTIONARY_ID}/_all Source: https://www.textrazor.com/docs/rest Retrieves a paginated list of all categories for a specific classifier. ```APIDOC ## GET /categories/{DICTIONARY_ID}/_all ### Description Returns a list of all categories for a classifier, supporting pagination via limit and offset. ### Method GET ### Endpoint https://api.textrazor.com/categories/{DICTIONARY_ID}/_all ### Parameters #### Query Parameters - **limit** (integer) - Optional - Number of results to return. - **offset** (integer) - Optional - Number of results to skip. ``` -------------------------------- ### GET /categories/{DICTIONARY_ID}/{CATEGORY_ID} Source: https://www.textrazor.com/docs/rest Retrieves a specific category object by ID. ```APIDOC ## GET /categories/{DICTIONARY_ID}/{CATEGORY_ID} ### Description Returns a Category object by its ID. ### Method GET ### Endpoint https://api.textrazor.com/categories/{DICTIONARY_ID}/{CATEGORY_ID} ``` -------------------------------- ### List all dictionaries Source: https://www.textrazor.com/docs/rest Returns a list of all Dictionary objects in your account. ```bash curl -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/entities/ ``` -------------------------------- ### Retrieve account information Source: https://www.textrazor.com/docs/rest Fetches the complete Account object for usage monitoring. ```bash curl -X GET \ -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/account/ ``` -------------------------------- ### Create a new dictionary Source: https://www.textrazor.com/docs/rest Creates a new dictionary using properties provided in the JSON body. ```bash curl -XPUT -H 'x-textrazor-key: YOUR_API_KEY' \ -d '{"matchType":"token", "caseInsensitive":true, "language":"eng"}' \ https://api.textrazor.com/entities/test_ents ``` -------------------------------- ### POST / Source: https://www.textrazor.com/docs/rest The main endpoint for all analysis functions. Requests must be application/x-www-form-urlencoded and include an API key in the X-TextRazor-Key header. ```APIDOC ## POST / ### Description Main endpoint for all analysis functions. Requests should include at least "url" or "text" parameters, as well as one or more "extractors" to control the operations performed. ### Method POST ### Endpoint / ### Request Body - **url** (string) - Optional - The URL of the document to analyze. - **text** (string) - Optional - The raw text to analyze. - **extractors** (string) - Required - A comma-separated list of extractors to run. - **X-TextRazor-Key** (header) - Required - Your API key for authentication. ``` -------------------------------- ### List dictionary entries with pagination Source: https://www.textrazor.com/docs/rest Returns all entities in a dictionary with paging information. Use limit and offset parameters to control the response size. ```bash curl -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/entities/test_ents/_all?limit=20&offset=0 ``` -------------------------------- ### Create or update a classifier with CSV Source: https://www.textrazor.com/docs/rest Uploads a classifier using a CSV file with an application/csv Content-Type. ```bash curl -XPUT -H 'Content-Type: application/csv' \ -H 'x-textrazor-key: YOUR_API_KEY' \ --data-binary '@classifier_file.csv' \ https://api.textrazor.com/categories/sport ``` -------------------------------- ### List all categories in a classifier Source: https://www.textrazor.com/docs/rest Retrieves a paginated list of categories for a specific classifier. ```bash curl -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/categories/sport/_all?limit=20&offset=0 ``` -------------------------------- ### POST /entities/{DICTIONARY_ID}/ Source: https://www.textrazor.com/docs/rest Adds entries to this dictionary. ```APIDOC ## POST /entities/{DICTIONARY_ID}/ ### Description Adds entries to this dictionary. Entries must be a JSON array of objects corresponding to properties of the new DictionaryEntry objects. ### Method POST ### Endpoint /entities/{DICTIONARY_ID}/ ### Parameters #### Path Parameters - **DICTIONARY_ID** (string) - Required - The unique identifier for the dictionary. ### Request Example [ {"text": "Bjarne Stroustrup", "id": "DEV2"} ] ``` -------------------------------- ### Retrieve a category by ID Source: https://www.textrazor.com/docs/rest Fetches the details of a specific category within a classifier. ```bash curl -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/categories/sport/101 ``` -------------------------------- ### Create or update a classifier with JSON Source: https://www.textrazor.com/docs/rest Uploads a new classifier or updates an existing one using a JSON body with an application/json Content-Type. ```bash curl -XPUT -H 'x-textrazor-key: YOUR_API_KEY' \ -H 'Content-Type: application/json' \ -d '[category_json,..]'' \ https://api.textrazor.com/categories/sport ``` -------------------------------- ### Add entries to a dictionary Source: https://www.textrazor.com/docs/rest Adds entries to a dictionary using a JSON array of objects. Existing entries with matching IDs will be overwritten. ```bash curl -XPOST -H 'x-textrazor-key: YOUR_API_KEY' \ -d '[{"text":"Bjarne Stroustrup","id":"DEV2"}]' https://api.textrazor.com/entities/test_ents/ ``` -------------------------------- ### POST https://api.textrazor.com/ Source: https://www.textrazor.com/docs/rest Analyzes text or content from a URL using specified extractors and configuration options. ```APIDOC ## POST https://api.textrazor.com/ ### Description Analyzes the provided text or URL content based on the selected extractors and configuration parameters. ### Method POST ### Endpoint https://api.textrazor.com/ ### Parameters #### Request Body - **entities.dictionaries** (string) - Optional - List of custom entity dictionary IDs. - **entities.filterDbpediaTypes** (list) - Optional - List of DBPedia types to filter entities. - **entities.filterFreebaseTypes** (list) - Optional - List of Freebase types to filter entities. - **entities.includeAddressPlaces** (boolean) - Optional - Enables extraction of places within postal addresses. - **extractors** (list) - Required - List of analysis functions to perform (entities, topics, words, phrases, dependency-trees, relations, entailments, senses, spelling). - **languageOverride** (string) - Optional - ISO-639-2 language code to force analysis language. - **rules** (string) - Optional - Prolog logic for custom rule evaluation. - **text** (string) - Optional - Raw text to be analyzed (max 200kb). - **url** (string) - Optional - Publicly accessible URL to fetch content from. ### Request Example curl -X POST \ -H "x-textrazor-key: YOUR_API_KEY" \ -d "extractors=entities" \ -d "entities.includeAddressPlaces=true" \ -d "url=https://example.com/article" ### Response #### Success Response (200) - **time** (number) - Total processing time in seconds. - **response** (object) - The output of the requested operation. - **ok** (boolean) - True if analysis was successful. - **error** (string) - Error message if any. - **message** (string) - Warning or informational messages. - **entities** (list) - List of extracted entities. - **topics** (list) - List of topics. - **categories** (list) - List of categories. - **sentences** (list) - List of sentences. #### Response Example { "time": 0.123, "response": { "entities": [], "topics": [], "sentences": [] }, "ok": true, "error": "", "message": "" } ``` -------------------------------- ### PUT /categories/{CLASSIFIER_ID} (CSV) Source: https://www.textrazor.com/docs/rest Creates or replaces a classifier using a CSV file upload. ```APIDOC ## PUT /categories/{CLASSIFIER_ID} ### Description Creates or replaces a classifier by uploading a CSV file containing Category ID, Category Label, and Category Query. ### Method PUT ### Endpoint https://api.textrazor.com/categories/{CLASSIFIER_ID} ### Parameters #### Path Parameters - **CLASSIFIER_ID** (string) - Required - The unique identifier for the classifier. ``` -------------------------------- ### PUT /entities/{DICTIONARY_ID} Source: https://www.textrazor.com/docs/rest Creates a new dictionary using properties provided in the JSON body. ```APIDOC ## PUT /entities/{DICTIONARY_ID} ### Description Creates a new dictionary using properties provided in the JSON body. ### Method PUT ### Endpoint /entities/{DICTIONARY_ID} ### Parameters #### Path Parameters - **DICTIONARY_ID** (string) - Required - The unique identifier for the dictionary. ### Request Example { "matchType": "token", "caseInsensitive": true, "language": "eng" } ``` -------------------------------- ### Define API Endpoint Source: https://www.textrazor.com/docs/rest The base URL for accessing the TextRazor API services. ```text http://api.textrazor.com ``` -------------------------------- ### Define a classifier CSV format Source: https://www.textrazor.com/docs/rest The expected structure for CSV files when uploading categories to a classifier. ```text Category ID,Category Label,Category Query ``` ```text classifer_file.csv: 100,Golf,concept('sport>golf') 101,Squash,concept('sport>squash') 102,Cricket,concept('sport>cricket') ``` -------------------------------- ### PUT /categories/{CLASSIFIER_ID} Source: https://www.textrazor.com/docs/rest Creates or updates a classifier using a JSON body of categories. ```APIDOC ## PUT /categories/{CLASSIFIER_ID} ### Description Creates a new classifier or adds categories to an existing one using a JSON request body. ### Method PUT ### Endpoint https://api.textrazor.com/categories/{CLASSIFIER_ID} ### Parameters #### Path Parameters - **CLASSIFIER_ID** (string) - Required - The unique identifier for the classifier. ``` -------------------------------- ### Define Secure API Endpoint Source: https://www.textrazor.com/docs/rest The recommended base URL for secure API communication over HTTPS. ```text https://api.textrazor.com ``` -------------------------------- ### POST https://api.textrazor.com/ Source: https://www.textrazor.com/docs/rest Performs language analysis on the provided text based on the specified extractors. ```APIDOC ## POST https://api.textrazor.com/ ### Description Performs language analysis on the provided text. Callers specify extractors to control the range of analysis features, such as entity extraction or relation analysis. ### Method POST ### Endpoint https://api.textrazor.com/ ### Parameters #### Request Body - **text** (string) - Required - The text content to be analyzed. - **extractors** (string) - Required - A comma-separated list of analysis features to perform (e.g., "entities,entailments"). ### Request Example curl -X POST \ -H "x-textrazor-key: YOUR_API_KEY" \ -d "extractors=entities,entailments" \ -d "text=Spain's stricken Bankia expects to sell off its vast portfolio of industrial holdings that includes a stake in the parent company of British Airways and Iberia." \ https://api.textrazor.com/ ### Response #### Success Response (200) - **response** (object) - The structured analysis result containing entities, relations, or other requested data. #### Error Responses - **400** (Bad Request) - Invalid request format or encoding. - **401** (Unauthorized) - Invalid API key or quota exceeded. - **413** (Request too large) - Request exceeds the 200kb limit. - **500** (Internal Server Error) - Server-side processing error. ``` -------------------------------- ### Delete a dictionary Source: https://www.textrazor.com/docs/rest Deletes a dictionary and all its entries by ID. ```bash curl -XDELETE -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/entities/test_ents ``` -------------------------------- ### Delete a specific dictionary entry Source: https://www.textrazor.com/docs/rest Deletes a specific entity by ID. Deleting the whole dictionary is recommended for performance over individual entry deletion. ```bash curl -XDELETE -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/entities/test_ents/DEV2 ``` -------------------------------- ### TextRazor JSON Response Structure Source: https://www.textrazor.com/docs/rest Schema representation of the JSON object returned by the TextRazor API. ```json { "time":"TIME", "response":{ "cleanedText":"CLEANED_TEXT", "sentences":[SENTENCE_JSON, ...], "entities":[ENTITY_JSON, ...], "categories":[CATEGORY_JSON, ...], "topics":[TOPIC_JSON, ...], "entailments":[ENTAILMENT_JSON, ...], "relations":[RELATION_JSON, ...], "properties":[PROPERTY_JSON, ...], "nounPhrases":[NOUNPHRASE_JSON, ...], } } ``` -------------------------------- ### DELETE /entities/{DICTIONARY_ID}/{ENTITY_ID} Source: https://www.textrazor.com/docs/rest Deletes a specific entity by id. ```APIDOC ## DELETE /entities/{DICTIONARY_ID}/{ENTITY_ID} ### Description Deletes a specific entity by id. ### Method DELETE ### Endpoint /entities/{DICTIONARY_ID}/{ENTITY_ID} ### Parameters #### Path Parameters - **DICTIONARY_ID** (string) - Required - The unique identifier for the dictionary. - **ENTITY_ID** (string) - Required - The unique identifier for the entity. ``` -------------------------------- ### DELETE /entities/{DICTIONARY_ID} Source: https://www.textrazor.com/docs/rest Deletes a dictionary and all its entries by id. ```APIDOC ## DELETE /entities/{DICTIONARY_ID} ### Description Deletes a dictionary and all its entries by id. ### Method DELETE ### Endpoint /entities/{DICTIONARY_ID} ### Parameters #### Path Parameters - **DICTIONARY_ID** (string) - Required - The unique identifier for the dictionary. ``` -------------------------------- ### DELETE /categories/{DICTIONARY_ID}/{CATEGORY_ID} Source: https://www.textrazor.com/docs/rest Deletes a specific category object by ID. ```APIDOC ## DELETE /categories/{DICTIONARY_ID}/{CATEGORY_ID} ### Description Deletes a specific Category object by ID. ### Method DELETE ### Endpoint https://api.textrazor.com/categories/{DICTIONARY_ID}/{CATEGORY_ID} ``` -------------------------------- ### Delete a category by ID Source: https://www.textrazor.com/docs/rest Removes a single category from a classifier. ```bash curl -X DELETE \ -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/categories/sport/101 ``` -------------------------------- ### DELETE /categories/{CLASSIFIER_ID} Source: https://www.textrazor.com/docs/rest Deletes a classifier and all its associated categories. ```APIDOC ## DELETE /categories/{CLASSIFIER_ID} ### Description Deletes a Classifier and all its Categories by ID. ### Method DELETE ### Endpoint https://api.textrazor.com/categories/{CLASSIFIER_ID} ### Parameters #### Path Parameters - **CLASSIFIER_ID** (string) - Required - The unique identifier for the classifier. ``` -------------------------------- ### Delete a classifier Source: https://www.textrazor.com/docs/rest Removes a classifier and all its associated categories by ID. ```bash curl -X DELETE \ -H 'x-textrazor-key: YOUR_API_KEY' \ https://api.textrazor.com/categories/sport ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.