Subscribe for Developer news

Web Service API Documentation

This page is work in progress













API 2.2 Documentation

Overview

API Overview

SemanticWire Developer API 2.2 Alpha is service designed to provide access to machine readable news content through a portfolio of application programming interfaces (API).

What is the service about:
	Our spiders are monitoring thousands of news sources, industry publications and corporate press releases.
	Rich set of semantic metadata, including entities, facts, events, categories and more is extracted from the news in near real time.
	The web service API allows you to use the extracted semantic metadata.

What you should know before you start:
	- You can only use the Web Service API for non commercial use or for applications in development.
	- Every time you show result based on our Web Service API you need to include a visible and readable link "Powered By Semantic Wire" which will point to http://www.semanticwire.com/
	- A person / company / organization who uses our Web Service API can only make API calls with one IP / API Key.
	- All previous rules could be waved if you have a written consent from us.
	- The service has alpha state and the API is not final. Changes could be done without warning. 

Conventions:
	In request uri syntax, variable names are shown in braces { }. Optional parameters are shown in brackets [ ]. Do not type the braces and brackets in the request.

Getting Help:
	For technical help, use our Contact Form or send email to admin [at] semanticwire.com .
	Subscribe for developers news.
	
Here is a list on what you can do with our API web service:
	- Search for News Articles. The search is done by creating a Filters. We support the following types of Filter Models:
		- Time Filter - Represents timeframe on the published news.
		- Topics Filter.
		- Tag Filter - Tags emulate how a person would tag a specific news article.
		- Subdomain Filter - Filter by source of news articles. Example news.yahoo.com
		- Entity Filters - Here are some of the entity types we support: Person, Company, Organization, Country, Product, Industry Term, Market Index and many more.
		- Action Filter - Filter by action type or specific action. Action Type could be: Arrest, Bankruptcy, Buybacks, Company Force Majeure, Company Investment, PDA Phase, Man Made Disaster, Merger, Trial and more.
		- DocumentGroup Filter - News with same story are grouped in "DocumentGroup". 
		- Document Filter - You can create your filter with specific documents.
		
	Filter Methods can include or excuse the matching news articles. The result from one filter could be used as input for another filter.
	After a Filter call you get back a Filter ID for the created "news pool". Use Views to pull information out of the 'news pool'.

	- View Methods we support:
		- Document View. Just get title, description, link and some more info about the news articles in your news pool.
		- DocumentGroups View. Group all the news articles who discuss same story and count news in the group. Shows what the top headlines are, helps you measure news coverage. 
		- Statistics View. Shows statistic by Topics, Tag, Entity Types and Subdomain. Example Statistics over Entity Type: Person would show chart data with top people from the news in your filter.
		- Actions View. Actions are links between entities with a type. Actions View shows extracted actions from your filter.
		
To get started go through the documentation. It will not take more the 30 minutes.
	
	

Authentication

Authentication is optional for most API calls.
Providing an API Key will authenticate you as registered user/developer.
Authenticated users have greater call limits and the ability save, edit, delete and refresh your filters.
All filters created with out an API Key will have live of 3600 seconds and will never refresh.

To receive an API Key register register and then go to User/profile from the main menu.

To authenticate yourself as registered developer add parameter api_key:{Your_API_Key} in the url when making API calls.
All parameters in the url are separated by forward slash '/'

Example:
	curl http://www.semanticwire.com/api/v2.2/filters/api_key:{Your_API_Key}.json 
	- returns all filters created by the API Key

Response Formats

All calls methods can return HTML, JSON, XML or CSV formatted response data.
To chose response format your endpoint should end with extension: '.html', '.json', '.xml' or '.csv'
No extension defaults to HTML formatted response.
Examples:
	http://www.semanticwire.com/api/v2.2/library/Organization
	http://www.semanticwire.com/api/v2.2/library/Organization.json
	http://www.semanticwire.com/api/v2.2/library/Organization.xml
	http://www.semanticwire.com/api/v2.2/library/Organization.csv

Request Formats

Some of the API call methods require data to be sent to the server via POST or PUT. The sent data could be in valid JSON or XML format.
The server will auto detect the data format by its content. Content-type header is not required.

Example:
	To filter news published in last two days and having Topic "Politics" you need to send data:
		JSON format:
			{"Filter":{"start_date":"-2 days", "end_date":"now", "conditions":" Topic.name = 'Politics' "}}
			
		XML format:
			<Filter>
				<start_date>-2 days</start_date>
				<end_date>-2 days</end_date>
				<conditions>Topic.name = 'Politics'</conditions>
			</Filter>


All examples in the documentation will be done with JSON format.

Status Code and Messages

	Request status:
		Show the status of the request. All json or xml requests return response code and messages.

	Response Codes ( status ):
		'OK'				- Successful request
		'WARNING'			- Your request has been modified but result data has been returned.
		'VALIDATION_ERROR'	- Validation on the sent data did not pass.
		'ERROR'				- Something went wrong. No result data is returned.
		
	For description of reason you get a Response Code check messages.
	
	
	Example of JSON response with validation error:
	
	{
	  "status": "VALIDATION_ERROR",
	  "messages": [
	    "Validation Error."
	  ],
	  "validation_errors": {
	    "start_date": [
	      "Invalid date: last 2 apples"
	    ]
	  },
	  "cache": {
	    "use_cache": 0,
	    "expires": "2012-11-19 14:14:34",
	    "last_modified": "2012-11-19 14:14:34",
	    "request_date": "2012-11-19 14:14:34"
	  },
	  "meta": {
	    "content_type": "text/plain; charset=UTF-8",
	    "server_addr": "127.0.0.1",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "POST",
	    "request_time": 1353352474,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "site0.dev",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0",
	    "remote_addr": "127.0.0.1"
	  },
	  "pagination": [],
	  "data": []
	}

Pagination

Pagination is used for returning a limited number of results from API call. Most of our API calls support Pagination.
	
	The Pagination itself and all Pagination parameters are always optional. If not set the defaults will be used for formatting the API call.
	All call methods who support Pagination will give information in their method documentation.
	Pagination information as number or records and pages is returned in the result if you supply parameter count:1 in the url

Pagination parameters:
		limit		- Shows how many results to return. Most API calls will return 20 results by default and have different maximum limits.
		page		- Which page of results to return. Number of pages will be returned with result from the API call if count:1 is included in the call.
		sort		- What criteria to sort the result ( ORDER BY ). Every method which supports sort will give more information.
		direction	- Accepts asc ( ascending sort ) or desc ( descending sort )
		count		- Accepts 1 or 0 (default). Whether or not to return count of all the matching results and calculated number of pages.
		
Example:
	curl http://www.semanticwire.com/api/v2.2/filters/api_key:{Your_API_Key}/limit:5/page:1/sort:Filter.created/direction:/asc.json
	

API Usage Quotas


Filter Refresh Point limits:
	Register user: 300 refreshes per day.
	Unregistered user: 150 refreshes per day.
	
	One Filter Refresh Point is taken every time your filter is refreshed. 
	A refresh is done when a filter is first time created, when refresh period is due or when you force refresh.
	When refreshing nested filters one point is taken for every filter.
	
	
View Point limits:
	Register user: 300 view calls per day.
	Unregistered user: 150 view calls per day.
	
	One View Point is taken every time you request information over the news filtered by your filter.
	Example: When you get statistics on the Topic from a filter or when you request links for news articles from your filter.


Usage endpoint:
	GET /api/v2.1/usage/[api_key:your_api_key][Extension]
	
	Returns your usage and limits data. 
	
Example:
	curl http://www.semanticwire.com/api/v2.2/usage.json 
	
	{
	  "status": "ok",
	  "messages": [],
	  "cache": {
	    "use_cache": 0,
	    "expires": "2012-07-09 00:53:10",
	    "last_modified": "2012-07-09 00:53:10",
	    "request_date": "2012-07-09 00:53:10"
	  },
	  "meta": {
	    "content_type": "N/A",
	    "server_addr": "127.0.0.1",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "GET",
	    "request_time": 1341809590,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "site0.dev",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "127.0.0.1"
	  },
	  "pagination": [],
	  "data": {
	    "Usage": {
	      "using_api_key": 0,
	      "filter_refresh_usage": 36,
	      "view_call_usage": 71,
	      "view_call_usage_day_limit": 150,
	      "filter_refresh_usage_day_limit": 150,
	      "reset_date": "2012-07-09 22:07:52"
	    }
	  }
	}

*All limits shown are defaults and can be set different per API Key.
*All limits are subject to change in the future.

Filter ( Filter news by your conditions )

Filter Endpoints


Create Filter

Endpoint: POST /api/v2.2/filters/[API_KEY][Extension] Data with filter description must be sent via POST. If no API_KEY is used the created filter will be alive only one hour. To create a filter you must first specify the time frame on published news you are interested in. This way the system can work over a chunk from the millions of news in the database. To specify the time frame you have to post JSON or XML data with root "Filter" and time description. Example: Request: curl http://www.semanticwire.com/api/v2.2/filters.json -X POST -d '{"Filter":{"start_date":"-2 days", "end_date":"now"}}' Response: { "status": "OK", "messages": [ "Filter has been created." ], "validation_errors": [], "cache": { "use_cache": 0, "expires": "2012-11-27 16:05:16", "last_modified": "2012-11-27 16:05:16", "request_date": "2012-11-27 16:05:16" }, "meta": { "content_type": "text/plain; charset=UTF-8", "server_addr": "127.0.0.1", "server_protocol": "HTTP/1.1", "request_method": "POST", "request_time": 1354050316, "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "http_accept_charset": "N/A", "http_accept_encoding": "gzip, deflate", "http_host": "site0.dev", "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0", "remote_addr": "127.0.0.1" }, "pagination": [], "data": { "Filter": { "id": "50b52b0c-31e0-4f6c-995e-0cd1aa6ff6ac", "name": "In use with api_key only!", "description": "In use with api_key only!", "parent_id": [], "status": "OK", "start_date": "-2 days", "end_date": "now", "conditions": "", "document_count": 48280, "input_document_count": 0, "refresh_date": "2012-11-27 17:05:16", "refresh_period": 3600, "last_refreshed": "2012-11-27 16:05:16", "created": "2012-11-27 16:05:16", "modified": "2012-11-27 16:05:16", "start_date_parsed": "2012-11-25 16-05-16", "end_date_parsed": "2012-11-27 16-05-16" } } } The data with filter description has JSON structure: { "Filter": { "name": "Just a test", "description": "Just a test" "parent_id": [], "start_date": "-2 days", "end_date": "now", "conditions": "", } } Tags "start_date" and "end_date" will filter all news published between the two dates. The two dates can take about any english description of time. Examples of date format: '-2 weeks', 'now', '10 September 2010', '-1 day', '-1 week 2 days 4 hours 2 seconds', 'last Monday', '30/06/11 23:59:59'. Relevant time format as '-2 weeks' will give different result in time. Static time format as ( May 15 2011 ) will always give same result. All dates will be parsed with the php's strtotime function. Creating filter without "start_date" and "end_date" is only permitted when you have at least one "parent_id" when nesting filters. There is a system limit currently set to 1500000 as maximum news any filter can hold. Filter name is required when a Filter is created with an api_key. Other then "Time Frame" Filter you can filter down by any of the supported Filter Models. For list of Filter Models see next section - Filter Models. Filtering news by Filter Models is done by sending "conditions" in the posted data. The "conditions" have format: { "conditions" : "FilterModel.property = value" or "conditions" : "FilterModel.{property = value or another_property >= value}" } Examles: Filter news containing "Topic" with name: "Disaster_Accident" for last 4 days Request: curl http://www.semanticwire.com/api/v2.2/filters.json -X POST -d ' { "Filter": { "start_date": "-4 days", "end_date": "now", "conditions": "Topic.name = 'Disaster Accident'" } }' Rsponce: { "status": "OK", "messages": [ "Filter has been created." ], "validation_errors": [], "cache": { "use_cache": 1, "expires": "2012-11-30 16:17:16", "last_modified": "2012-11-27 16:17:16", "request_date": "2012-11-27 16:18:17" }, "meta": { "content_type": "text/plain; charset=UTF-8", "server_addr": "127.0.0.1", "server_protocol": "HTTP/1.1", "request_method": "POST", "request_time": 1354051096, "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "http_accept_charset": "N/A", "http_accept_encoding": "gzip, deflate", "http_host": "site0.dev", "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0", "remote_addr": "127.0.0.1" }, "pagination": [], "data": { "Filter": { "id": "50b52e18-2b14-485f-ab16-0cd2aa6ff6ac", "name": "In use with api_key only!", "description": "In use with api_key only!", "parent_id": [], "status": "OK", "start_date": "-4 days", "end_date": "now", "conditions": "Topic.name = 'Disaster_Accident'", "document_count": 4010, "input_document_count": 0, "refresh_date": "2012-11-27 17:18:16", "refresh_period": 3600, "last_refreshed": "2012-11-27 16:18:16", "created": "2012-11-27 16:18:16", "modified": "2012-11-27 16:18:17", "start_date_parsed": "2012-11-23 16-18-16", "end_date_parsed": "2012-11-27 16-18-16" } } } Filter news containing "Tag" with name: "Police Brutality" for the last 7 days Request: curl http://www.semanticwire.com/api/v2.2/filters.json -X POST -d ' { "Filter": { "start_date": "-1 week", "end_date": "now", "conditions": "Tag.name = 'Police Brutality'" } }' Rsponce: { "status": "OK", "messages": [ "Filter has been created." ], "validation_errors": [], "cache": { ... ... }, "meta": { ... ... }, "pagination": [], "data": { "Filter": { "id": "50b52f07-df24-4129-acb3-0ce3aa6ff6ac", "name": "In use with api_key only!", "description": "In use with api_key only!", "parent_id": [], "status": "OK", "start_date": "-1 week", "end_date": "now", "conditions": "Tag.name = 'Police Brutality'", "document_count": 9, "input_document_count": 0, "refresh_date": "2012-11-27 17:22:16", "refresh_period": 3600, "last_refreshed": "2012-11-27 16:22:16", "created": "2012-11-27 16:22:15", "modified": "2012-11-27 16:22:16", "start_date_parsed": "2012-11-20 16-22-16", "end_date_parsed": "2012-11-27 16-22-16" } } } Filter news containing person "Barack Obama". We support "PersonDisambiguated" and "Person" Filter models. Always choose a Disambiguated if available for better results. "PersonDisambiguated" would group filter models "Person" with names: "Barack Obama", "Obama", "Barack H. Obama" and others under single ID. Request: curl http://www.semanticwire.com/api/v2.2/filters.json -X POST -d ' { "Filter": { "start_date": "-5 days", "end_date": "now", "conditions": "PersonDisambiguated.name = 'Barack Obama'" } }' Response: { "status": "OK", "messages": [ "Filter has been created." ], "validation_errors": [], "cache": { ... }, "meta": { ... }, "pagination": [], "data": { "Filter": { "id": "50b5315c-2dd4-433e-ac26-0cd0aa6ff6ac", "name": "In use with api_key only!", "description": "In use with api_key only!", "parent_id": [], "status": "OK", "start_date": "-5 days", "end_date": "now", "conditions": "PersonDisambiguated.name = 'Barack Obama'", "document_count": 3769, "input_document_count": 0, "refresh_date": "2012-11-27 17:32:12", "refresh_period": 3600, "last_refreshed": "2012-11-27 16:32:12", "created": "2012-11-27 16:32:12", "modified": "2012-11-27 16:32:12", "start_date_parsed": "2012-11-22 16-32-12", "end_date_parsed": "2012-11-27 16-32-12" } } } All Entity Filter Models support an optional "relevance" property. The relevance shows how important the target entity is for the news content. It scales from 0 to 100. Entity with relevance greater then 20 play important role in the news. By setting relevance property you would target news who have or don't have Entity with the right relevance. Previous "Barack Obama" Filter but now with relevance > 25. This way "Barack Obama" is not only mentioned in the news. Request: curl http://www.semanticwire.com/api/v2.2/filters.json -X POST -d ' { "Filter": { "start_date": "-5 days", "end_date": "now", "conditions": "PersonDisambiguated.{ name = 'Barack Obama' and relevance > 25 }" } }' Response: { "status": "OK", "messages": [ "Filter has been created." ], "validation_errors": [], "cache": { ... }, "meta": { ... }, "pagination": [], "data": { "Filter": { "id": "50b531cb-e950-443d-bb3f-0155aa6ff6ac", "name": "In use with api_key only!", "description": "In use with api_key only!", "parent_id": [], "status": "OK", "start_date": "-5 days", "end_date": "now", "conditions": "PersonDisambiguated.{ name = 'Barack Obama' and relevance > 25 }", "document_count": 2241, "input_document_count": 0, "refresh_date": "2012-11-27 17:34:03", "refresh_period": 3600, "last_refreshed": "2012-11-27 16:34:03", "created": "2012-11-27 16:34:03", "modified": "2012-11-27 16:34:04", "start_date_parsed": "2012-11-22 16-34-03", "end_date_parsed": "2012-11-27 16-34-03" } } } You can also filter news with more then one model with in the news. "conditions": "PersonDisambiguated.name = 'Barack Obama' and PersonDisambiguated.name = 'Mitt Romney'" will return news who have Barack Obama and Mitt Romney in them "conditions": "PersonDisambiguated.name = 'Barack Obama' or PersonDisambiguated.name = 'Mitt Romney'" will return news who have Barack Obama or Mitt Romney in them ( at least one of them ) "conditions": "(PersonDisambiguated.name = 'Barack Obama' or PersonDisambiguated.name = 'Michelle Obama') and PersonDisambiguated.name = 'Mitt Romney'" will return news who have Barack Obama or Michelle Obama and Mitt Romney in them Use '%' (percent sign) with in any string property to match "starts with" or "ends with" "conditions": "PersonDisambiguated.name = '%Obama'" will return news who have people whose name ends with "Obama"; You can filter by "negative match". Use "!" as not sign if in front of the model. "conditions": " !PersonDisambiguated.name = 'Barack Obama' " will return news who DO NOT contain Barack Obama; You can mix all the Filter models ("Topic", "Currency", "Organization", "ManMadeDisaster" ... ) with in the conditions. "conditions": " !PersonDisambiguated.name = 'Barack Obama' and Topic.name = 'Politics' and !Topic.name = 'War Conflict' and City.{ ( name = 'London%' or name = 'Paris' ) and relevance >= 15 } and ( Organization.name = 'European Central Bank' or Currency.name = 'EUR' ) " ( NOTE: this is invalid JSON because of the new lines. If you want to send this condition to the server will have to replace/remove the new lines or send it as XML ) You can create condition with Filter Model without property description. Example "condition": " Person " will filter news who contain a Person. It could be any Person. This is only useful when used with Action Filter Models. Example: "condition": " Merger or CompanyAffiliates or Bankruptcy " To find what "Topic" names ( or other Model names ) we support ( have in library ) make a library call ( see "Library" section from documentation).

Other Filter Endpoints:

Endpoint: GET /api/v2.2/filters/{API_KEY}/[Pagination][Extension] Description: List filters for API Key. Api Key is required. Endpoint: GET /api/v2.2/filters/{Filter_id}/[API_KEY][Extension] Description: View filter by ID. Endpoint: PUT /api/v2.2/filters/{Filter_id}/{API_KEY}[Extension] Description: Edit filter. Changes to current filter need to be send via PUT. Api Key is required. Endpoint: DELETE /api/v2.2/filters/{Filter_id}/{API_KEY}[Extension] Description: Delete one filter. Api Key is required. Endpoint: GET /api/v2.2/filters/refres/{Filter_id}/{API_KEY}[Extension] Description: Force refresh on filter. Api Key is required.

Filter Models (What to filter by)


General Filter Models:

Filter Model:Description:
TopicTopics attempt to identify the "aboutness" of the submitted content input - the topic or topics that the content discusses. It is possible that more than one topic will be assigned to the input content, or that no topics will be assigned.
TagTags attempt to emulate how a person would tag a specific piece of content. For example, if you submit a story about Barack Obama and a piece of legislation – at least one reasonable tag would be “U.S. legislation”. A story about the relative merits of BMWs, Ferraris and Porsches should probably be tagged “sports cars” and “luxury makes” as well as "auto racing" and "motorsport".
SubdomainShows the source of publication ( subdomain name ).

Entity Filter Models:

Filter Model:Description:
AnniversaryExtracts a reference to an anniversary.
CityExtracted name of a city or independent settlement (including villages, settlements, etc.) Note: Districts or neighborhoods within a city (e.g., "in the Soho, London") are not extracted.
CityDisambiguatedDisambiguated city name.
CompanyExtracts a full or partial company name (the term "Company" includes any business organization, including newspapers, media companies, law firms, etc.). The name is normalized to the fullest name occurring withi
CompanyDisambiguatedDisambiguated company name.
ContinentExtracts a name of a continent.
CountryExtracts a name of a country, normalized to the fullest name occurring within the document.
CountryDisambiguatedDisambiguated country name.
CurrencyExtracts a reference to a currency.
DateDate
ElectronicDisambiguatedDisambiguated product name of type Electronics.
EmailAddressAn email address.
EntertainmentAwardEventExtracts references to entertainment-related events and awards, such as film and music festivals and awards related to the entertainment industry.
FacilityExtracts a proper name of a man-made, specific structure or a group of structures that provide(s) a particular service or is(are) used for a particular industry.
FaxNumberExtracts a full fax number, including prefix and extension, if available.
HolidayExtracts references of holidays.
IndustryTermExtracts a description of an industry, segment, product family, or business.
MarketIndexExtracts a name of a stock market index. The name is normalized to the common name of the index, e.g., "S&P 500" or "FTSE 100".
MedicalConditionExtracts references to human medical conditions, such as diseases, disorders and syndromes.
MedicalTreatmentExtracts references to medical treatments - procedures, treatments and therapeutics provided to any medical condition.
MovieExtracts references to movies and films.
MusicAlbumExtracts references to music albums, CDs, etc.
MusicGroupExtracts references to music groups and bands.
NaturalFeatureExtracts a name of a specific geographical (not manmade) entity, such as a geological formation or body of water.
OperatingSystemExtracts references to operating systems.
OrganizationExtracts a full or partial organization name, including governmental and military organization. Any business organization extracted as Company is not extracted as Organization. The name is normalized to the fullest name occurring within the document, or to the full, official name listed within the Organization dictionary (whichever is longer).
PersonExtracts one of the following types of person references in the text: 1. A full or partial person name. 2. A full or partial person name with aliases, nicknames or tribal names. In such cases, the normalized name includes the alias/nickname/tribal name inside quotes or parentheses at the middle or end of the name, according to its appearance in the document. If there is a sequence of two aliases for the same person, they appear with a "/" between them. If the alias/nickname/tribal name appears by itself later in the document, it will also be extracted. 3. Anaphora of the form he/she/his/him/her, which refers to a person name previously mentioned in the document. The IM resolves the anaphora and extracts it with the relevant person name. In each case, the name is normalized to the fullest name occurring in the document. Note: The event/fact PersonDetails also extracts a full or partial person name, along with position, affiliation and other person details. If the Person instance includes ONLY the name and no affiliation, the PersonDetails instance will NOT be extracted, ONLY the Person instance will be extracted.
PersonDisambiguatedThe name with which a person is commonly referred by.
PhoneNumberExtracts a full phone number, including prefix and extension, if available.
PoliticalEventExtracts references to political events.
PositionExtracts information concerning position that a person holds, will hold, or held.
ProductThe entity type extracts references to products. The product type is extracted for the following product types: drug products, electronic products, car models, aircraft models, and weapons.
ProgrammingLanguageExtracts references to programming languages.
ProvinceOrStateExtracts the name of a province, state or county or other politically defined part of a country (normalized to the full name).
ProvinceOrStateDisambiguatedDisambiguated province or state name.
PublishedMediumExtracts references to published media, such as newspapers, journals and magazines.
RadioProgramExtracts references to radio programs.
RadioStationExtracts references to radio stations. This entity type is currently focused on U.S. radio stations, although it may identify non-U.S. stations as well.
RegionExtracts a name of a (non-politically defined) geographical region of theworld (excluding continents).
SportsEventExtracts references to sports-related tournaments and championships.
SportsGameExtracts references to sports games like football, baseball, soccer, etc.
SportsLeagueExtracts names of sports leagues. Note that some sports leagues may also be extracted as organizations.
TechnologyExtracted technology name or a description of the technology.
TVShowExtracts references to TV shows and programs.
TVStationExtracts references to TV stations. This entity type is currently focused on U.S. TV stations, although it may identify non-U.S. stations as well.
URLExtracts a URL or FTP address.

Action Filter Models:

Filter Model:Description:
ManMadeDisasterExtracts references to disasters and incidents that originate in non-natural processes such as fires, nuclear disasters, oil spills and explosions.
CompanyReorganizationExtracts references to the event of corporate reorganization/restructuring.
QuotationExtracts quotes from people.
MergerExtracts a reference to a merger transaction (past, present or future). May also be extracted from the document title.
DiplomaticRelationsExtracts information about diplomatic relations between diplomatic entities (i.e., countries, governments, minority groups, regions, international organizations or a person who is a spokesperson for a group).
PersonCommunicationExtracts references to communications (meetings, phone calls or direct verbal communication) between two or more people or groups of people. The references are to communication/meetings that actually took place, alleged to have taken place, or planned communication/meetings. The persons may be referred to by their actual explicit names (i.e., proper names) or by a description, or rarely by their organization or facility.
CompanyAffiliatesExtracts references to a parent company or subsidiary relationship between two companies.
ProductIssuesExtracts information concerning problems found in products. It may also extract information about product issues where no specific product is mentioned if the company is identified.
ProductRecallExtracts references to recall of products.
EmploymentChangeExtracts an announcement about a recent appointment, retirement (including dismissal) or promotion of an executive (or several executives) in a company or organization. May also be extracted from the document title.
PoliticalEndorsementExtracts information about endorsements between parties, people or lobbies.
NaturalDisasterExtracts references to natural disasters – e.g., hurricanes, earthquakes, floods - occurring anywhere in the world.
PersonTravelExtracts references to past, present or future travel of people, from one concrete place (origin) to another (destination).
FDAPhaseExtracts mentions of FDA phases for drugs - the stage in the US Food and Drug Administration’s approval process.
PoliticalRelationshipExtracts a reference to a mentioned relation between two political entities, such as political parties, people or lobbies. These relationships can be of two types: 'alliance' or 'rivalry'. Note: Endorsment relationships are not extracted.
BankruptcyExtracts references to bankruptcy issues that involve companies: Corporate insolvencies and bankruptcies, where a company has filed for bankruptcy or been declared insolvent. Voluntary and involuntary insolvency proceedings including creditor protection actions such as Chapter 11 federal bankruptcy code proceedings in the U.S. and administration orders elsewhere as well receiverships. Company ceasing trading, bankruptcy court rulings and a company's emergence from a bankruptcy protection or administration process.
PollsResultExtracts information about results of a vote, received in a poll.
ExtinctionExtracts references to an animal/plant life almost ceasing to exist.
EnvironmentalIssueExtracts instances of an issue having an effect on the environment at any particular location or on a particular date.
CompanyLaborIssuesExtracts production stoppages brought about by labor disagreements, negotiations etc.
IndictmentExtracts references to an indictment of a person or group of people (charged with criminal offenses).
ConvictionExtracts references to a conviction of an individual or group of people.
ArrestExtracts references to the arrest of a person or a group of persons.
BusinessRelationExtracts a reference to a business agreement, signed recently or in the past, between two or more companies. Note: Agreements phrased as "alliances" or "partnerships" are extracted as an Alliance. "Weaker" contacts are extracted as a BusinessRelation.
TrialExtracts references to the trial of a person or group of people.
MovieReleaseExtracts references to movie releases (past, present or future) or mentions of new movies.
AllianceExtracts a reference to an alliance agreement signed recently, or in the past, between two or more companies.
ProductReleaseExtracts references to a company releasing a product including the release status.
VotingResultExtracts information about results of a vote.
DividendExtracts information about dividends paid to shareholders by a company.
AcquisitionExtracts a reference to an acquisition (in the past, present or future) of shares in a company or of assets of another company. May also be extracted from the document title.
CompanyExpansionExtracts two types of company expansion: a company entering a new market, and a company creating a new unit.
CompanyInvestmentExtracts references to an investment in one company by another company.
CompanyLayoffsExtracts references to an event of a company reducing its workforce by cutting the number of employees, jobs, positions, etc.
IPOExtracts references to an Initial Public Offering (IPO) of stock by a company.
DelayedFilingExtracts references to a delay in filing reports by a company.
CompanyForceMajeureExtracts interruption of regular activity in a company due to unexpected external events.
CompanyEarningsAnnouncementExtracts references to an official announcement, made by the publicly traded company itself, regarding its financial earnings results. May also be extracted from the document title.
MusicAlbumReleaseExtracts references to music album releases (past, present or future) or mentions of new music albums.
BuybacksExtracts references to a company’s plan to repurchase its own securities in the open market (buyback events).
CompanyLegalIssuesExtracts references to one of the following legal issues that involve a company: Class Action: A legal action against a company or companies where an individual represents a group in a court claim. Corporate Litigation: Lawsuits/Litigation involving corporate entities that can have a material effect on the future actions/finances of the companies involved.
AnalystEarningsEstimateExtract reports about estimates given by external analysts regarding the future (i.e., not-yet-reported) financial results of a publicly-traded company.
AnalystRecommendationExtracts references to a recommendation by an analyst (of an investment bank or similar organization) regarding shares of a publicly traded company. The recommendation should be regarding shares (equity) only. Any recommendation regarding bonds or other credit instruments is not extracted by this concept. May also be extracted from the document title.
SecondaryIssuanceExtracts references to stockissuances by companies, which aren't initial issuances. (Initial issuance of stock is extracted by the IPO event/fact.)
JointVentureExtracts a reference to a joint-venture agreement, signed recently or in the past. May also be extracted from the document title.
PatentFilingExtracts references to companies or organizations filing for patent registration and information about the patent.
CompanyNameChangeExtracts references to the event of changing the name of a company.
CompanyListingChangeExtracts a reference to any change in listing for a company in any known stock exchange, i.e., companies added or removed from any one of the stock exchanges.
CompanyEarningsGuidanceExtracts references to a projected earnings, made by the publicly traded company itself.
CompanyMeetingExtracts references to a shareholders’ meeting held by a company.
DebtFinancingExtracts Debt Financing information from the finance related documents
CompanyUsingProductExtract references to customer companies or organizations using products of provider companies. The product can be either product name or product description.
ConferenceCallExtracts references to conference calls (in the past, present or future) held by a company, usually to report their financial results for the latest period.
PatentIssuanceExtracts references to patents being issued/granted for comanies or organizations who filed them. It also includes information about the issued patents.
StockSplitExtracts references to a stock split declared by a company.
CompanyAccountingChangeExtracts references to a company's change in its accounting method or policy, i.e., change of fiscal year, change of depreciation policy or new accounting standards.
BonusSharesIssuanceExtracts references to bonus shares issues (in the past, present or future).
CompanyRestatementExtracts references to a company restatement of its financial statement for some period(s).
EquityFinancingExtracts information pertaining to equity financing (usually secondary issuance of the securities or new issuance of other stocks).
IndicesChangesExtracts references change in any individual financial index, i.e., companies added or removed from one of the indices. An index change should only be noted if the company is being removed for lack of presentation and not because of a merger/acquisition transaction.
ArmedAttackExtracts information referring to any attack by a country or an organization, or an attack on a leader or political figure.
ArmsPurchaseSaleExtracts references to an arms deal.
CandidatePositionExtracts information about political election (current or past) candidates (including mayoral) and their positions: aspirations as well as current and past positions.
MilitaryActionExtracts references to non-combative action taken by the military.

Document Filter Model:

Filter Model:Description:
DocumentUsed to specify a news from the database.
DocumentGroup(temporarily restricted!).

Library

Overview:	
	Used to find the properties of a Filter Model.
	
Call Format:
	GET /api/v2.2/library/{FilterModel}/[Pagination]/[API_KEY]{Extension}
( List paginated result of all FilterModel ordered by news_score )

Call Format:
	POST /api/v2.2/library/{FilterModel}/[Pagination]/[API_KEY].{Extension}
( Return only FilterModels who match posted conditions )
Posted JSON have format:
{
	"ViewFilter": {
		"conditions":" name = 'foo' or name = 'bar' "
	}
}

Pagination defaults: 
	limit:20/page:1/direction:desc/sort:news_score/count:0

Pagination sort options: 
	news_score - shows a score on how often the entity is found in the news. Updates once a week.
	
FilterModel could be one of Tag, Topic, Subdomain, and all entity Filter Models.
Full list:
Anniversary, City, CityDisambiguated, Company, CompanyDisambiguated, Continent, Country, CountryDisambiguated, Currency, ElectronicDisambiguated, EmailAddress, EntertainmentAwardEvent, Facility, FaxNumber, Holiday, IndustryTerm, MarketIndex, MedicalCondition, MedicalTreatment, Movie, MusicAlbum, MusicGroup, NaturalFeature, OperatingSystem, Organization, Person, PersonDisambiguated, PhoneNumber, PoliticalEvent, Position, Product, ProgrammingLanguage, ProvinceOrState, ProvinceOrStateDisambiguated, PublishedMedium, RadioProgram, RadioStation, Region, Subdomain, SportsEvent, SportsGame, SportsLeague, Tag, Technology, Topic, TVShow, TVStation, URL
	
Examples: 
	http://www.semanticwire.com/api/v2.2/library/Topic
	( shows all topics we support in html format)

	curl http://www.semanticwire.com/api/v2.2/library/PersonDisambiguated.json -X POST -d '
	{
		"ViewFilter": {
			"conditions": "name = 'David Cameron' "
		}
	}'
	Response:
	{
	  "status": "OK",
	  "messages": [],
	  "validation_errors": [],
	  "cache": {
	    ...
	  },
	  "meta": {
	    ...
	  },
	  "pagination": {
	    "sort": null,
	    "direction": null
	  },
	  "data": [
	    {
	      "PersonDisambiguated": {
	        "id": "44741",
	        "name": "David Cameron",
	        "news_score": "3734"
	      }
	    }
	  ]
	}
	

	curl http://www.semanticwire.com/api/v2.2/library/CityDisambiguated/limit:3.json -X POST -d '
	{
		"ViewFilter": {
			"conditions": " name = 'London%' "
		}
	}'
		returns 3 CityDisambiguated models whose name starts with London
		
	

	curl http://www.semanticwire.com/api/v2.1/library/Organization/limit:10/page:2.json -X POST -d '
	{
		"ViewFilter": {
			"conditions": "name = '%bank%' "
		}
	}'
		returns second page of 10 Organization models whose name contains bank.


Views ( Get information out of your filter )

Documents ( Feeds )

Overview:	
	Setting up a filter will create a result 'news pool' - a number of news who match your filter conditions.
	Call to Documents View will return paginated result of all the news filtered by the previously created filter ( not grouped ).
	
Call Format:
	GET /api/v2.2/documents/{Filter_id}/[Pagination]/[API_KEY][Extension]
		
Pagination defaults: 
	limit:20/page:1/direction:desc/sort:Document.published_date/count:0

Pagination sort options: 
	Document.published_date - sort by published date.
	
Example:
	Request:
		curl http://www.semanticwire.com/api/v2.2/documents/50b640ef-51a0-4081-a175-0cd2aa6ff6ac/limit:2.json
	Response:
		{
		  "status": "OK",
		  "messages": [],
		  "validation_errors": [],
		  "cache": {
		    ...
		  },
		  "meta": {
		    ...
		  },
		  "pagination": {
		    "sort": null,
		    "direction": null
		  },
		  "data": [
		    {
		      "Document": {
		        "id": "20420458",
		        "published_date": "2012-11-28 11:47:12",
		        "document_group_id": "1",
		        "subdomain_id": "69",
		        "title": "Orlando ticket wins $2 million in Mega Money game",
		        "description": "TALLAHASSEE, Fla. (AP) — One ticket matched the four winning numbers plus the Mega Ball in the Mega Money game to collect a jackpot worth $2 million, the Florida Lottery said Wednesday.\n


\n

\n \n
", "url": "http://www.orlandosentinel.com/news/local/breakingnews/os-orlando-ticket-mega-money-winner-20121129,0,5010419.story" }, "Subdomain": { "id": "69", "name": "orlandosentinel.com", "news_score": "816" } }, { "Document": { "id": "20420272", "published_date": "2012-11-28 11:43:48", "document_group_id": "2234753", "subdomain_id": "5589", "title": "Hackers hit IAEA server,\npost expert details online", "description": "VIENNA: The UN atomic agency said on Wednesday that hackers had accessed one of its computer servers and posted the contact details of some of the watchdog's experts online.\n\nInternational Atomic Energy Agency spokeswoman Gill Tudor said \"some contact details\" related to experts working with the IAEA were published on Sunday on a hacker site.\n\nThe hackers posted a statement on Cryptome.org calling for an investigation", "url": "http://gulftoday.ae/portal/a159e231-a4a2-4266-88b5-5e3d23fd07ed.aspx" }, "Subdomain": { "id": "5589", "name": "gulftoday.ae", "news_score": "0" } } ] }

DocumentGroups

	
	THIS CALL IS TEMPORARY DISABLED 
	
Overview:	
	Setting up a filter will create a result 'news pool' - a number of news who match your filter conditions.
	All this news could come from different sources and all sources often publish same news.
	If two or more news discuss same story they are grouped in a DocumentGroup ( News Group ). 
	DocumentGroups news will help you identify the breaking which news in your filter.
	Call to DocumentGroups View will return paginated result of all the news groups, number of news in the group and latest inserted news.
	All news with in the result groups will the filter you have previously created.
	

Statistics

Shows statistics on chosen Filter Model over the news from previously created Filter
	
Call Format:
	GET /api/v2.2/statistics/{Filter_id}/{FilterModel}/[API_KEY][Extension]
	
Statistics With Condition Endpoint:
	POST /api/v2.1/statistics/{FilterModel}/{Filter_id}/[API_KEY][Extension]
	( Return only result who match posted conditions )
	Posted JSON have format:
	{
		"ViewFilter": {
			"conditions":" name in ['Name1', 'nam2', 'another name']"
		}
	}
	
Pagination defaults:
	limit:20/page:1/sort:document_count/direction:desc/count:0
	
Pagination sort options: 
	document_count, sum_relevance

Filter Model can be any of the supported filter models but "Document", "DocumentGroup" and all the Action Models.



Example:
	To get statistics on Filter Model "OperatingSystem" over a previously created Filter:
	Request:
		curl http://www.semanticwire.com/api/v2.2/statistics/50b640ef-51a0-4081-a175-0cd2aa6ff6ac/Organization.json
	Response:
		{
		  "status": "OK",
		  "messages": [],
		  "validation_errors": [],
		  "cache": {
		    "use_cache": 1,
		    "expires": "2012-11-28 12:50:55",
		    "last_modified": "2012-11-28 11:50:55",
		    "request_date": "2012-11-28 12:45:34"
		  },
		  "meta": {
		    "content_type": "N/A",
		    "server_addr": "127.0.0.1",
		    "server_protocol": "HTTP/1.1",
		    "request_method": "GET",
		    "request_time": 1354124733,
		    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
		    "http_accept_charset": "N/A",
		    "http_accept_encoding": "gzip, deflate",
		    "http_host": "site0.dev",
		    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0",
		    "remote_addr": "127.0.0.1"
		  },
		  "pagination": {
		    "sort": null,
		    "direction": null
		  },
		  "data": [
		    {
		      "Organization": {
		        "id": "10",
		        "name": "United Nations",
		        "news_score": "12756",
		        "document_count": "3743",
		        "sum_relevance": "136793"
		      }
		    },
		    {
		      "Organization": {
		        "id": "20",
		        "name": "Congress",
		        "news_score": "15763",
		        "document_count": "3381",
		        "sum_relevance": "107395"
		      }
		    },
		    {
		      "Organization": {
		        "id": "211",
		        "name": "European Union",
		        "news_score": "11858",
		        "document_count": "2651",
		        "sum_relevance": "93938"
		      }
		    },
		    {
		      "Organization": {
		        "id": "12",
		        "name": "White House",
		        "news_score": "16409",
		        "document_count": "1853",
		        "sum_relevance": "60681"
		      }
		    },
		    {
		      "Organization": {
		        "id": "692",
		        "name": "Hamas",
		        "news_score": "3846",
		        "document_count": "1680",
		        "sum_relevance": "66661"
		      }
		    },
		    {
		      "Organization": {
		        "id": "324",
		        "name": "Senate",
		        "news_score": "8744",
		        "document_count": "1466",
		        "sum_relevance": "49168"
		      }
		    },
		    {
		      "Organization": {
		        "id": "2190",
		        "name": "Press Complaints Commission",
		        "news_score": "114",
		        "document_count": "1455",
		        "sum_relevance": "40552"
		      }
		    },
		    {
		      "Organization": {
		        "id": "43671",
		        "name": "Un court",
		        "news_score": "0",
		        "document_count": "1403",
		        "sum_relevance": "32595"
		      }
		    },
		    {
		      "Organization": {
		        "id": "25",
		        "name": "Republican Party",
		        "news_score": "8748",
		        "document_count": "1353",
		        "sum_relevance": "47770"
		      }
		    },
		    {
		      "Organization": {
		        "id": "111",
		        "name": "federal government",
		        "news_score": "6454",
		        "document_count": "1274",
		        "sum_relevance": "36189"
		      }
		    },
		    {
		      "Organization": {
		        "id": "19",
		        "name": "International Monetary Fund",
		        "news_score": "8657",
		        "document_count": "1245",
		        "sum_relevance": "40290"
		      }
		    },
		    {
		      "Organization": {
		        "id": "16",
		        "name": "army",
		        "news_score": "4887",
		        "document_count": "1045",
		        "sum_relevance": "27841"
		      }
		    },
		    {
		      "Organization": {
		        "id": "734",
		        "name": "Muslim Brotherhood",
		        "news_score": "715",
		        "document_count": "1039",
		        "sum_relevance": "37495"
		      }
		    },
		    {
		      "Organization": {
		        "id": "357",
		        "name": "Supreme Court",
		        "news_score": "4204",
		        "document_count": "942",
		        "sum_relevance": "32461"
		      }
		    },
		    {
		      "Organization": {
		        "id": "299",
		        "name": "National Football League",
		        "news_score": "2077",
		        "document_count": "928",
		        "sum_relevance": "31993"
		      }
		    },
		    {
		      "Organization": {
		        "id": "343",
		        "name": "US Federal Reserve",
		        "news_score": "8225",
		        "document_count": "915",
		        "sum_relevance": "21401"
		      }
		    },
		    {
		      "Organization": {
		        "id": "83",
		        "name": "Obama administration",
		        "news_score": "6569",
		        "document_count": "854",
		        "sum_relevance": "23804"
		      }
		    },
		    {
		      "Organization": {
		        "id": "203",
		        "name": "U.S. Securities and Exchange Commission",
		        "news_score": "3095",
		        "document_count": "724",
		        "sum_relevance": "27237"
		      }
		    },
		    {
		      "Organization": {
		        "id": "93",
		        "name": "Medicare",
		        "news_score": "4555",
		        "document_count": "716",
		        "sum_relevance": "22620"
		      }
		    },
		    {
		      "Organization": {
		        "id": "108",
		        "name": "Federal Bureau of Investigation",
		        "news_score": "3896",
		        "document_count": "658",
		        "sum_relevance": "22775"
		      }
		    }
		  ]
		}

Time Line

	Shows time line of the news your filter gets per day.
	Since the number published news depends on the day of the week ( Monday much more news published then Sunday ), holidays, submitting new sources to the system or other factors, we find time line activity to be best presented as percent of all news for the day.
	
Time Line Call format:	
	/api/v2.2/timeline/{Filter_id}/[API_KEY][Extension]
	
Pagination is not supported.


Example: 
	Timeline on previously created filter with last week and Topic: Disaster Accident.
	
	Request:
		curl http://www.semanticwire.com/api_v22/timelines/index/50b65182-44f8-416c-b364-0152aa6ff6ac.json
	Response:
		{
		  "status": "OK",
		  "messages": [],
		  "validation_errors": [],
		  "cache": {
		    "use_cache": 1,
		    "expires": "2012-11-28 14:14:45",
		    "last_modified": "2012-11-28 13:14:45",
		    "request_date": "2012-11-28 13:14:45"
		  },
		  "meta": {
		    "content_type": "N/A",
		    "server_addr": "127.0.0.1",
		    "server_protocol": "HTTP/1.1",
		    "request_method": "GET",
		    "request_time": 1354126485,
		    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
		    "http_accept_charset": "N/A",
		    "http_accept_encoding": "gzip, deflate",
		    "http_host": "site0.dev",
		    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:16.0) Gecko/20100101 Firefox/16.0",
		    "remote_addr": "127.0.0.1"
		  },
		  "pagination": [],
		  "data": [
		    {
		      "Day": {
		        "date": "2012-11-21",
		        "min_published_date": "2012-11-21 13:16:00",
		        "max_published_date": "2012-11-21 23:59:00",
		        "document_count": 511,
		        "total_document_count": 12035
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-11-22",
		        "min_published_date": "2012-11-22 00:00:00",
		        "max_published_date": "2012-11-22 23:59:00",
		        "document_count": 1086,
		        "total_document_count": 23931
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-11-23",
		        "min_published_date": "2012-11-23 00:00:00",
		        "max_published_date": "2012-11-23 23:56:00",
		        "document_count": 1019,
		        "total_document_count": 22246
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-11-24",
		        "min_published_date": "2012-11-24 00:00:00",
		        "max_published_date": "2012-11-24 23:57:00",
		        "document_count": 819,
		        "total_document_count": 14757
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-11-25",
		        "min_published_date": "2012-11-25 00:00:00",
		        "max_published_date": "2012-11-25 23:58:00",
		        "document_count": 922,
		        "total_document_count": 15773
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-11-26",
		        "min_published_date": "2012-11-26 00:00:00",
		        "max_published_date": "2012-11-26 23:59:00",
		        "document_count": 1380,
		        "total_document_count": 27457
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-11-27",
		        "min_published_date": "2012-11-27 00:00:00",
		        "max_published_date": "2012-11-27 23:59:00",
		        "document_count": 1151,
		        "total_document_count": 29645
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-11-28",
		        "min_published_date": "2012-11-28 00:00:00",
		        "max_published_date": "2012-11-28 12:38:00",
		        "document_count": 541,
		        "total_document_count": 11855
		      }
		    }
		  ]
		}

Relations

	Shows extracted relations (actions) between entities of the news in your filter.
	
Relations Call format:	
	/api/v2.2/relations/{Filter_id}/{ActionModel}/[API_KEY][Extension]

RelationModel is one of Relation Filter Models ( see Filter Models ).

Pagination defaults:
	limit:20/page:1/sort:document_count/direction:desc/count:0

Pagination sort options: 
	document_count

	Example: 

		Request:
			curl /api/v2.2/relations/50b65182-44f8-416c-b364-0152aa6ff6ac/ProductRecall
		Response:
			{
			  "status": "OK",
			  "messages": [],
			  "validation_errors": [],
			  "cache": {
			    ...
			  },
			  "meta": {
			    ...
			  },
			  "pagination": {
			    "sort": null,
			    "direction": null
			  },
			  "data": [
			    {
			      "ProductRecall": {
			        "id": "59016",
			        "document_count": "5",
			        "created": "2012-11-23 02:27:35",
			        "total_document_count": "9",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "3052",
			              "name": "tainted beef",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "3060543",
			              "name": "postponed"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "882",
			        "document_count": "5",
			        "created": "2010-10-02 01:21:01",
			        "total_document_count": "440",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "140",
			              "name": "food",
			              "news_score": "54"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59257",
			        "document_count": "3",
			        "created": "2012-11-26 21:12:10",
			        "total_document_count": "14",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "40",
			              "name": "company_recalling",
			              "name_nice": "Company Recalling",
			              "description": "Company that is recalling a product"
			            },
			            "Company": {
			              "id": "2250526",
			              "name": "Sunland Inc.",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "330775",
			              "name": "organic and non-organic nut butters",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "41",
			              "name": "recalledquantity",
			              "name_nice": "Recalled Quantity",
			              "description": "Quantity of a product that is being recalled"
			            },
			            "Literal": {
			              "id": "2060608",
			              "name": "Hundreds"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "2521530",
			              "name": "known"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "11207",
			        "document_count": "3",
			        "created": "2010-12-05 04:49:33",
			        "total_document_count": "268",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "40",
			              "name": "company_recalling",
			              "name_nice": "Company Recalling",
			              "description": "Company that is recalling a product"
			            },
			            "Company": {
			              "id": "355757",
			              "name": "CFIA's Food",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "18919",
			              "name": "Report",
			              "news_score": "13"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59113",
			        "document_count": "3",
			        "created": "2012-11-23 21:34:42",
			        "total_document_count": "3",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "40",
			              "name": "company_recalling",
			              "name_nice": "Company Recalling",
			              "description": "Company that is recalling a product"
			            },
			            "Company": {
			              "id": "2428246",
			              "name": "Capital Packers",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "330060",
			              "name": "ham sausages",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "41",
			              "name": "recalledquantity",
			              "name_nice": "Recalled Quantity",
			              "description": "Quantity of a product that is being recalled"
			            },
			            "Literal": {
			              "id": "4925948",
			              "name": "two brands"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59114",
			        "document_count": "3",
			        "created": "2012-11-23 21:34:42",
			        "total_document_count": "3",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "225023",
			              "name": "sausages",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "41",
			              "name": "recalledquantity",
			              "name_nice": "Recalled Quantity",
			              "description": "Quantity of a product that is being recalled"
			            },
			            "Literal": {
			              "id": "16777215",
			              "name": "the increase had a large negative impact on student enrollment"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "58994",
			        "document_count": "2",
			        "created": "2012-11-22 14:48:18",
			        "total_document_count": "2",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "92091",
			              "name": "cherry tomatoes",
			              "news_score": "1"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "2521530",
			              "name": "known"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "5893",
			        "document_count": "2",
			        "created": "2010-10-25 19:20:44",
			        "total_document_count": "50",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "33",
			              "name": "items",
			              "news_score": "9"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "43435",
			        "document_count": "2",
			        "created": "2012-05-12 17:03:58",
			        "total_document_count": "6",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "63173",
			              "name": "butter",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "2521530",
			              "name": "known"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59080",
			        "document_count": "2",
			        "created": "2012-11-23 14:37:48",
			        "total_document_count": "2",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "330060",
			              "name": "ham sausages",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "41",
			              "name": "recalledquantity",
			              "name_nice": "Recalled Quantity",
			              "description": "Quantity of a product that is being recalled"
			            },
			            "Literal": {
			              "id": "16777215",
			              "name": "the increase had a large negative impact on student enrollment"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "14",
			        "document_count": "2",
			        "created": "2010-10-01 02:21:50",
			        "total_document_count": "738",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "57",
			              "name": "Product",
			              "news_score": "91"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59171",
			        "document_count": "1",
			        "created": "2012-11-25 06:58:03",
			        "total_document_count": "1",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "330337",
			              "name": "victims of personal injury",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59387",
			        "document_count": "1",
			        "created": "2012-11-28 09:55:05",
			        "total_document_count": "1",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "331549",
			              "name": "G-U Hardware window fittings",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "2521530",
			              "name": "known"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59004",
			        "document_count": "1",
			        "created": "2012-11-22 18:32:50",
			        "total_document_count": "1",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "40",
			              "name": "company_recalling",
			              "name_nice": "Company Recalling",
			              "description": "Company that is recalling a product"
			            },
			            "Company": {
			              "id": "238",
			              "name": "Volkswagen",
			              "news_score": "471"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "296",
			              "name": "Beetle",
			              "news_score": "20"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "1173967",
			              "name": "Car"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "41",
			              "name": "recalledquantity",
			              "name_nice": "Recalled Quantity",
			              "description": "Quantity of a product that is being recalled"
			            },
			            "Literal": {
			              "id": "16777215",
			              "name": "the increase had a large negative impact on student enrollment"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59192",
			        "document_count": "1",
			        "created": "2012-11-26 01:02:04",
			        "total_document_count": "1",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "40",
			              "name": "company_recalling",
			              "name_nice": "Company Recalling",
			              "description": "Company that is recalling a product"
			            },
			            "Company": {
			              "id": "57212",
			              "name": "Big W",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "330431",
			              "name": "varieties of Christmas LED rope lights",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "68",
			              "name": "company_distributor",
			              "name_nice": "Company Distributor",
			              "description": "Company that is a distributor of products"
			            },
			            "Company": {
			              "id": "57212",
			              "name": "Big W",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "2521530",
			              "name": "known"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "1614",
			        "document_count": "1",
			        "created": "2010-10-05 16:09:29",
			        "total_document_count": "458",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "57",
			              "name": "Product",
			              "news_score": "91"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "3032831",
			              "name": "planned"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59005",
			        "document_count": "1",
			        "created": "2012-11-22 18:32:50",
			        "total_document_count": "1",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "40",
			              "name": "company_recalling",
			              "name_nice": "Company Recalling",
			              "description": "Company that is recalling a product"
			            },
			            "Company": {
			              "id": "238",
			              "name": "Volkswagen",
			              "news_score": "471"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "329914",
			              "name": "Safety Defect",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "41",
			              "name": "recalledquantity",
			              "name_nice": "Recalled Quantity",
			              "description": "Quantity of a product that is being recalled"
			            },
			            "Literal": {
			              "id": "16777215",
			              "name": "the increase had a large negative impact on student enrollment"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "2521530",
			              "name": "known"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "13548",
			        "document_count": "1",
			        "created": "2011-01-05 00:09:21",
			        "total_document_count": "3",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "16961",
			              "name": "Lists",
			              "news_score": "1"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "944109",
			              "name": "announced"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "2031",
			        "document_count": "1",
			        "created": "2010-10-07 09:37:46",
			        "total_document_count": "3",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "14397",
			              "name": "Trampolines",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "3213918",
			              "name": "rumored"
			            }
			          }
			        ]
			      }
			    },
			    {
			      "ProductRecall": {
			        "id": "59009",
			        "document_count": "1",
			        "created": "2012-11-22 21:38:58",
			        "total_document_count": "1",
			        "Properties": [
			          {
			            "PropertyType": {
			              "id": "24",
			              "name": "product",
			              "name_nice": "Product",
			              "description": "Canonic name of a product entity that is a particpant in an event/fact"
			            },
			            "Product": {
			              "id": "329928",
			              "name": "injections of the steroid",
			              "news_score": "0"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "25",
			              "name": "producttype",
			              "name_nice": "Product Type",
			              "description": "Product classification. Possible values: drug, car, aircraft electronics. N/A"
			            },
			            "Literal": {
			              "id": "2932199",
			              "name": "Other"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Literal": {
			              "id": "16566805",
			              "name": "after the September"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "41",
			              "name": "recalledquantity",
			              "name_nice": "Recalled Quantity",
			              "description": "Quantity of a product that is being recalled"
			            },
			            "Literal": {
			              "id": "16777215",
			              "name": "the increase had a large negative impact on student enrollment"
			            }
			          },
			          {
			            "PropertyType": {
			              "id": "7",
			              "name": "status",
			              "name_nice": "Status",
			              "description": "Status of various events and facts based on the context of the text. For example: announced, planned, cancelled, postponed, rumored, known, closed, new, etc."
			            },
			            "Literal": {
			              "id": "2521530",
			              "name": "known"
			            }
			          }
			        ]
			      }
			    }
			  ]
			}

API 2.1 Documentation

Overview

API Overview

SemanticWire Developer API 2.1 Alpha is service designed to provide access to machine readable news content through a portfolio of application programming interfaces (API).

What is the service about:
	Our spiders are monitoring thousands of news sources, industry publications and corporate press releases.
	Rich set of semantic metadata, including entities, facts, events, categories and more is extracted from the news in near real time.
	The web service API allows you to use the extracted semantic metadata.

What you should know before you start:
	- You can only use the Web Service API for non commercial use or for applications in development.
	- Every time you show result based on our Web Service API you need to include a visible and readable link "Powered By Semantic Wire" which will point to http://www.semanticwire.com/
	- A person / company / organization who uses our Web Service API can only make API calls with one IP / API Key.
	- All previous rules could be waved if you have a written consent from us.
	- The service has alpha state and the API is not final. Changes could be done without warning. 

Conventions:
	In request uri syntax, variable names are shown in braces { }. Optional parameters are shown in brackets [ ]. Do not type the braces and brackets in the request.

Getting Help:
	For technical help, use our Contact Form or send email to admin [at] semanticwire.com .
	Subscribe for developers news.
	
Here is a list on what you can do with our API web service:
	- Search for News Articles. The search is done by creating a Filters. We support the following types of Filter Models:
		- Time Filter - Represents timeframe on the published news.
		- Topics Filter.
		- Tag Filter - Tags emulate how a person would tag a specific news article.
		- Subdomain Filter - Filter by source of news articles. Example news.yahoo.com
		- Entity Filters - Here are some of the entity types we support: Person, Company, Organization, Country, Product, Industry Term, Market Index and many more.
		- Action Filter - Filter by action type or specific action. Action Type could be: Arrest, Bankruptcy, Buybacks, Company Force Majeure, Company Investment, PDA Phase, Man Made Disaster, Merger, Trial and more.
		- DocumentGroup Filter - News with same story are grouped in "DocumentGroup". 
		- Document Filter - You can create your filter with specific documents.
		
	Filter Methods can include or excuse the matching news articles. The result from one filter could be used as input for another filter.
	After a Filter call you get back a Filter ID for the created "news pool". Use Views to pull information out of the 'news pool'.

	- View Methods we support:
		- Document View. Just get title, description, link and some more info about the news articles in your news pool.
		- DocumentGroups View. Group all the news articles who discuss same story and count news in the group. Shows what the top headlines are, helps you measure news coverage. 
		- Statistics View. Shows statistic by Topics, Tag, Entity Types and Subdomain. Example Statistics over Entity Type: Person would show chart data with top people from the news in your filter.
		- Actions View. Actions are links between entities with a type. Actions View shows extracted actions from your filter.
		
To get started go through the documentation. It will not take more the 30 minutes.
	
	

Authentication

Authentication is optional for most API calls.
Providing an API Key will authenticate you as registered developer and will give you greater call limits and the ability edit, delete and refresh your filters.
All filters created with out an API Key will have live of 3600 seconds and will never refresh.

To receive an API Key register register and then go to User/profile from the main menu.

To authenticate yourself as registered developer add parameter api_key:{Your_API_Key} in the url when making API calls.
All parameters in the url are separated by forward slash '/'

Example:
	curl http://www.semanticwire.com/api/v2.1/filters/api_key:{Your_API_Key}.json 
	- returns all filters created by the API Key

Response Formats

All calls methods can return JSON, XML or HTML formatted response data.
To chose response format your endpoint should end with extension: '.json', '.xml' or '.html'.
No extension defaults to HTML formatted response. HTML formatted response is used for for easier reading when debugging.
Examples:
	curl http://www.semanticwire.com/api/v2.1/filters/api_key:{Your_API_Key}.json 
	curl http://www.semanticwire.com/api/v2.1/filters/api_key:{Your_API_Key}.xml 
	curl http://www.semanticwire.com/api/v2.1/filters/api_key:{Your_API_Key}
	

Request Formats

Some of the API call methods require data to be sent to the server via POST or PUT. The sent data could be in valid JSON or XML format.
The server will auto detect the data format by its content. Content-type header is not required.

Example:
	To filter news published in last two days and having Topic politics you need to send data:
		JSON format:
			{"Filter":{"start_date":"-2 days", "end_date":"now", "conditions":{"and":{"Topic":[{"id":2}]}}}}
			
		XML format:
			<Filter>
				<start_date>-2 days</start_date>
				<end_date>-2 days</end_date>
				<conditions>
					<and>
						<Topic>
							<id>2</id>
						</Topic>
					</and>
				</conditions>
			</Filter>


All examples in the documentation will be done with JSON format.

Status Code and Messages

	Request status:
		Show the status of the request. All json or xml requests return response code and messages.

	Response Codes ( status ):
		'ok'				- Successful request
		'warning'			- Your request has been modified but result data has been returned.
		'validation_error'	- Validation on the sent data did not pass.
		'error'				- Something went wrong. No result data is returned.
		
	For description of reason you get a Response Code check messages.
	
	
	Example of JSON response with validation error:
	
	{
	  "status": "validation_error",
	  "messages": {
	    "validation_error": [
	      [
	        "Not all parent filter exits"
	      ]
	    ]
	  },
	  "cache": {
	    "use_cache": 0,
	    "expires": "2012-07-08 23:54:00",
	    "last_modified": "2012-07-08 23:54:00",
	    "request_date": "2012-07-08 23:54:00"
	  },
	  "meta": {
	    "content_type": "text/plain; charset=UTF-8",
	    "server_addr": "127.0.0.1",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "POST",
	    "request_time": 1341806040,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "site0.dev",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "127.0.0.1"
	  },
	  "pagination": [],
	  "data": []
	}

Pagination

Pagination is used for returning a limited number of results from API call. Most of our API calls support Pagination.
	
	The Pagination itself and all Pagination parameters are always optional. If not set the defaults will be used for formatting the API call.
	All call methods who support Pagination will give information in their method documentation.
	Pagination information as number or records and pages is returned in the result if you supply parameter count:1 in the url

Pagination parameters:
		limit		- Shows how many results to return. Most API calls will return 20 results by default and have different maximum limits.
		page		- Which page of results to return. Number of pages will be returned with result from the API call if count:1 is included in the call.
		sort		- What criteria to sort the result ( ORDER BY ). Every method which supports sort will give more information.
		direction	- Accepts asc ( ascending sort ) or desc ( descending sort )
		count		- Accepts 1 or 0 (default). Whether or not to return count of all the matching results and calculated number of pages.
		
Example:
	curl http://www.semanticwire.com/api/v2.1/filters/api_key:{Your_API_Key}/limit:5/page:1/sort:Filter.created/direction:/asc.json
	

API Usage Quotas


Filter Refresh Point limits:
	Register user: 300 refreshes per day.
	Unregistered user: 150 refreshes per day.
	
	One Filter Refresh Point is taken every time your filter is refreshed. 
	A refresh is done when a filter is first time created, when refresh period is due or when you force refresh.
	When refreshing nested filters one point is taken for every filter.
	
	
View Point limits:
	Register user: 300 view calls per day.
	Unregistered user: 150 view calls per day.
	
	One View Point is taken every time you request information over the news filtered by your filter.
	Example: When you get statistics on the Topic from a filter or when you request links for news articles from your filter.


Usage endpoint:
	GET /api/v2.1/usage{Extension}
	
	Returns your usage and limits data. 
	
Example:
	curl http://www.semanticwire.com/api/v2.1/usage.json 
	
	{
	  "status": "ok",
	  "messages": [],
	  "cache": {
	    "use_cache": 0,
	    "expires": "2012-07-09 00:53:10",
	    "last_modified": "2012-07-09 00:53:10",
	    "request_date": "2012-07-09 00:53:10"
	  },
	  "meta": {
	    "content_type": "N/A",
	    "server_addr": "127.0.0.1",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "GET",
	    "request_time": 1341809590,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "site0.dev",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "127.0.0.1"
	  },
	  "pagination": [],
	  "data": {
	    "Usage": {
	      "using_api_key": 0,
	      "filter_refresh_usage": 36,
	      "view_call_usage": 71,
	      "view_call_usage_day_limit": 150,
	      "filter_refresh_usage_day_limit": 150,
	      "reset_date": "2012-07-09 22:07:52"
	    }
	  }
	}

*All limits shown are defaults and can be set different per API Key.
*All limits are subject to change in the future.

Filter ( Filter news by your conditions )

Filter Endpoints


Create Filter

Endpoint: POST /api/v2.1/filters/[API_KEY][Extension] Data with filter description must be sent via POST. If no API_KEY is used the created filter will be alive only one hour. To create a filter you must first specify the time frame on published news you are interested in. This way the system can work over a chunk from the millions of news in the database. To specify the time frame you have to post JSON or XML data with root "Filter" and time description. Example: curl http://www.semanticwire.com/api/v2.1/filters.json -X POST -d '{"Filter":{"start_date":"-2 days", "end_date":"now"}}' { "status": "ok", "messages": { "ok": [ "Filter has been created." ] }, "cache": { "use_cache": 0, "expires": "2012-07-09 01:50:59", "last_modified": "2012-07-09 01:50:59", "request_date": "2012-07-09 01:50:59" }, "meta": { "content_type": "text/plain; charset=UTF-8", "server_addr": "127.0.0.1", "server_protocol": "HTTP/1.1", "request_method": "POST", "request_time": 1341813059, "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "http_accept_charset": "N/A", "http_accept_encoding": "gzip, deflate", "http_host": "site0.dev", "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1", "remote_addr": "127.0.0.1" }, "pagination": [], "data": { "Filter": { "id": "4ffa3d00-365c-4ae1-8535-9c3caa6ff6ac", "filter_hash": "1a7acb2f974e70b134490a43877b577e", "parent_id": [], "status": "OK", "start_date": "-2 days", "end_date": "now", "conditions": [], "document_count": 26476, "parent_document_count": 0, "refresh_date": "2012-07-09 02:50:16", "refresh_period": 3600, "last_refreshed": "2012-07-09 01:50:16", "title": "In use with api_key only!", "description": "In use with api_key only!", "created": "2012-07-08 22:08:00", "modified": "2012-07-09 01:50:16", "start_date_parsed": "2012-07-07 01-50-16", "end_date_parsed": "2012-07-09 01-50-16" } } } The data with filter description has JSON structure: { "Filter": { "parent_id": [], "start_date": "-2 days", "end_date": "now", "conditions": {}, "title": "", "description": "" } } Tags "start_date" and "end_date" will filter all news published between the two dates. The two dates can take about any english description of time. Examples of date format: '-2 weeks', 'now', '10 September 2010', '-1 day', '-1 week 2 days 4 hours 2 seconds', 'last Monday', '30/06/11 23:59:59'. Relevant time format as '-2 weeks' will give different result in time. Static time format as ( May 15 2011 ) will always give same result. All dates will be parsed with the php's strtotime function. Creating filter without "start_date" and "end_date" is only permitted when you have at least one "parent_id" when nesting filters. There is a system limit currently set to 1500000 as maximum news any filter can hold. Other then "Time Frame" Filter you can filter down by any of the supported Filter Models. For list of Filter Models see next section - Filter Models. Filtering news by Filter Models is done by sending "conditions" in the posted data. The "conditions" have format: { "conditions" : { rule: { FilterModel: { "id" : 323232 } } } } Rule is one of "and", "or", "not". All Filter Models with in rule "and" must match the filtered news. At least one Filter Model with in rule "or" must match the filtered news. All Filter Models with in rule "not" must not match the filtered news. Nested rules are currently not supported. You can emulate nested rules by creating nested filters. At before filtering by Filter Model you need to find the ID of the entity and then include it in a condition. To find and ID for Filter Models: "Tag", "Topic", "Subdomain" and all Entity Models use Library Call ( see section Library Calls ). To find and ID for Action Models make Action View call. To find and ID for Document Model make Document call. To find and ID for DocumentGroup Model make DocumentGroup call. Examles: Filter news containing "Topic" with name: "Disaster Accident"

Disaster Accident Filter example

Topics are only 18. You can get all the Topics with one call.
Request:
	curl http://www.semanticwire.com/api/v2.1/library/Topic.json
Response:
	{
	  "status": "ok",
	  "messages": [],
	  "cache": {
	    "use_cache": 1,
	    "expires": "2012-07-12 02:49:23",
	    "last_modified": "2012-07-09 02:49:23",
	    "request_date": "2012-07-09 02:49:23"
	  },
	  "meta": {
	    "content_type": "N/A",
	    "server_addr": "192.168.0.123",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "GET",
	    "request_time": 1341816563,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "www.semanticwire.com",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "71.68.41.160"
	  },
	  "pagination": {
	    "sort": null,
	    "direction": null
	  },
	  "data": [
	    {
	      "Topic": {
	        "id": "1",
	        "category": "http://d.opencalais.com/cat/Calais/DisasterAccident",
	        "classifier_name": "Calais",
	        "name": "Disaster_Accident",
	        "name_nice": "Disaster Accident",
	        "description": "Covers topics related to man-made and natural events resulting in damage to objects, loss of life or injury.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "2",
	        "category": "http://d.opencalais.com/cat/Calais/BusinessFinance",
	        "classifier_name": "Calais",
	        "name": "Business_Finance",
	        "name_nice": "Business Finance",
	        "description": "Covers topics such as corporate financial results, joint business ventures, global currencies, prices and markets, stocks and bonds, prices, economic forums.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "3",
	        "category": "http://d.opencalais.com/cat/Calais/HumanInterest",
	        "classifier_name": "Calais",
	        "name": "Human Interest",
	        "name_nice": "Human Interest",
	        "description": "Covers lighter topics of general interest for humans.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "4",
	        "category": "http://d.opencalais.com/cat/Calais/Politics",
	        "classifier_name": "Calais",
	        "name": "Politics",
	        "name_nice": "Politics",
	        "description": "Covers topics such as government policies and actions, politicians and political parties, elections, war and acts of aggression between countries.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "5",
	        "category": "http://d.opencalais.com/cat/Calais/Environment",
	        "classifier_name": "Calais",
	        "name": "Environment",
	        "name_nice": "Environment",
	        "description": "Covers topics related to the condition of our planet such as natural disasters, protection, and their effect on living species as well as inanimate objects or property",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "6",
	        "category": "http://d.opencalais.com/cat/Calais/Other",
	        "classifier_name": "Calais",
	        "name": "Other",
	        "name_nice": "Other",
	        "description": "Includes miscellaneous topics not covered by any of the other categories.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "7",
	        "category": "http://d.opencalais.com/cat/Calais/WarConflict",
	        "classifier_name": "Calais",
	        "name": "War_Conflict",
	        "name_nice": "War Conflict",
	        "description": "Covers topics related to acts of socially- or politically- motivated protest and/or violence.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "8",
	        "category": "http://d.opencalais.com/cat/Calais/EntertainmentCulture",
	        "classifier_name": "Calais",
	        "name": "Entertainment_Culture",
	        "name_nice": "Entertainment Culture",
	        "description": "Covers topics such as media, movies and TV, literature and journalism, music, celebrities, entertainment products, internet culture, youth culture.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "9",
	        "category": "http://d.opencalais.com/cat/Calais/Education",
	        "classifier_name": "Calais",
	        "name": "Education",
	        "name_nice": "Education",
	        "description": "Covers topics related to aspects of furthering knowledge of humans.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "10",
	        "category": "http://d.opencalais.com/cat/Calais/SocialIssues",
	        "classifier_name": "Calais",
	        "name": "Social Issues",
	        "name_nice": "Social Issues",
	        "description": "Covers topics related to aspects of the behavior of humans affecting the quality of life.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "11",
	        "category": "http://d.opencalais.com/cat/Calais/LawCrime",
	        "classifier_name": "Calais",
	        "name": "Law_Crime",
	        "name_nice": "Law Crime",
	        "description": "Covers topics relating to the enforcement of rules of behavior in society, breaches of these rules and the resulting punishments; law firms, legal practice and lawsuits.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "12",
	        "category": "http://d.opencalais.com/cat/Calais/Sports",
	        "classifier_name": "Calais",
	        "name": "Sports",
	        "name_nice": "Sports",
	        "description": "Covers topics such as sports competitions and tournaments, athletes, Olympic games.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "13",
	        "category": "http://d.opencalais.com/cat/Calais/HealthMedicalPharma",
	        "classifier_name": "Calais",
	        "name": "Health_Medical_Pharma",
	        "name_nice": "Health Medical Pharma",
	        "description": "Covers topics such as hospitals and healthcare, medical research, diseases, drugs, pharmaceutical industry, health insurance, diet and nutrition.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "14",
	        "category": "http://d.opencalais.com/cat/Calais/HospitalityRecreation",
	        "classifier_name": "Calais",
	        "name": "Hospitality_Recreation",
	        "name_nice": "Hospitality Recreation",
	        "description": "Covers topics such as eating and travel, leisure/recreational facilities and general activities undertaken for pleasure and relaxation.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "15",
	        "category": "http://d.opencalais.com/cat/Calais/ReligionBelief",
	        "classifier_name": "Calais",
	        "name": "Religion_Belief",
	        "name_nice": "Religion Belief",
	        "description": "Covers topics such as theology, philosophy, ethics and spirituality.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "16",
	        "category": "http://d.opencalais.com/cat/Calais/TechnologyInternet",
	        "classifier_name": "Calais",
	        "name": "Technology_Internet",
	        "name_nice": "Technology Internet",
	        "description": "Covers topics such as technological innovations, technology-related companies, hardware and software products, internet products and web sites, telecom industry.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "17",
	        "category": "http://d.opencalais.com/cat/Calais/Labor",
	        "classifier_name": "Calais",
	        "name": "Labor",
	        "name_nice": "Labor",
	        "description": "Covers topics related to the employment of individuals, support of the unemployed.",
	        "news_score": "0"
	      }
	    },
	    {
	      "Topic": {
	        "id": "18",
	        "category": "http://d.opencalais.com/cat/Calais/Weather",
	        "classifier_name": "Calais",
	        "name": "Weather",
	        "name_nice": "Weather",
	        "description": "Covers topics relating to meteorological phenomena.",
	        "news_score": "0"
	      }
	    }
	  ]
	}
	












Topic with name Disaster_Accident has ID: 1
Now make the Filter Call:
Request:
	curl http://www.semanticwire.com/api/v2.1/filters.json -X POST -d '
	{
		"Filter": {
			"start_date": "-4 days",
			"end_date": "now",
			"conditions": {
				"and": {
					"Topic": [
						{"id": 1}
					]
				}
			}
		}
	}'
Response:
	{
	  "status": "ok",
	  "messages": {
	    "ok": [
	      "Filter has been created."
	    ]
	  },
	  "cache": {
	    "use_cache": 0,
	    "expires": "2012-07-09 02:54:25",
	    "last_modified": "2012-07-09 02:54:25",
	    "request_date": "2012-07-09 02:54:26"
	  },
	  "meta": {
	    "content_type": "text/plain; charset=UTF-8",
	    "server_addr": "192.168.0.123",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "POST",
	    "request_time": 1341816865,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "www.semanticwire.com",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "71.68.41.160"
	  },
	  "pagination": [],
	  "data": {
	    "Filter": {
	      "id": "4ffa8002-259c-4e06-98c2-3c3dc0a8007b",
	      "filter_hash": "98aaec81a0f138a4acf59113d5c8d5c9",
	      "parent_id": [],
	      "status": "OK",
	      "start_date": "-4 days",
	      "end_date": "now",
	      "conditions": {
	        "and": {
	          "Topic": [
	            {
	              "id": 1
	            }
	          ]
	        }
	      },
	      "document_count": 4782,
	      "parent_document_count": 0,
	      "refresh_date": "2012-07-09 03:54:25",
	      "refresh_period": 3600,
	      "last_refreshed": "2012-07-09 02:54:25",
	      "title": "In use with api_key only!",
	      "description": "In use with api_key only!",
	      "created": "2012-07-09 02:53:54",
	      "modified": "2012-07-09 02:54:25",
	      "start_date_parsed": "2012-07-05 02-54-25",
	      "end_date_parsed": "2012-07-09 02-54-25"
	    }
	  }
	}
	



Tag document_count from returned data shows there are 4782 filtered news.	
	Filter news containing "Tag" with name: "Police Brutality"

Police Brutality News Filter example

First get the ID for Filter Model "Tag" with name "Police Brutality":
Request:
	curl http://www.semanticwire.com/api/v2.1/library/Tag.json -x POST -d '
	{
		"conditions": {
			"name" : "Police Brutality"
		}
	}'
Response:
	{
	  "status": "ok",
	  "messages": [],
	  "cache": {
	    "use_cache": 1,
	    "expires": "2012-07-12 03:00:09",
	    "last_modified": "2012-07-09 03:00:09",
	    "request_date": "2012-07-09 03:00:09"
	  },
	  "meta": {
	    "content_type": "text/plain; charset=UTF-8",
	    "server_addr": "192.168.0.123",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "POST",
	    "request_time": 1341817209,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "www.semanticwire.com",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "71.68.41.160"
	  },
	  "pagination": {
	    "sort": null,
	    "direction": null
	  },
	  "data": [
	    {
	      "Tag": {
	        "id": "60239",
	        "name": "Police brutality",
	        "news_score": "58"
	      }
	    }
	  ]
	}
	

Choose the result with the biggest news score. The Tag ID we will use is: 60239
If you wanted to list all Tag names who start with Police you should post JSON:
{"conditions": {"name" : "Police Brutality"}}



Now make the Filter call:
Request:
	curl http://www.semanticwire.com/api/v2.1/filters.json -X POST -d '
	{
		"Filter": {
			"start_date": "-4 days",
			"end_date": "now",
			"conditions": {
				"and": {
					"Tag": [
						{"id": 60239}
					]
				}
			}
		}
	}'
Response:
	{
	  "status": "ok",
	  "messages": {
	    "ok": [
	      "Filter has been created."
	    ]
	  },
	  "cache": {
	    "use_cache": 0,
	    "expires": "2012-07-09 03:03:24",
	    "last_modified": "2012-07-09 03:03:24",
	    "request_date": "2012-07-09 03:03:24"
	  },
	  "meta": {
	    "content_type": "text/plain; charset=UTF-8",
	    "server_addr": "192.168.0.123",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "POST",
	    "request_time": 1341817404,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "www.semanticwire.com",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "71.68.41.160"
	  },
	  "pagination": [],
	  "data": {
	    "Filter": {
	      "id": "4ffa821d-1938-47e2-b67a-40bdc0a8007b",
	      "filter_hash": "fe0270a81de5ed8741f4b3bfe96f0b01",
	      "parent_id": [],
	      "status": "OK",
	      "start_date": "-4 days",
	      "end_date": "now",
	      "conditions": {
	        "and": {
	          "Tag": [
	            {
	              "id": 60239
	            }
	          ]
	        }
	      },
	      "document_count": 12,
	      "parent_document_count": 0,
	      "refresh_date": "2012-07-09 04:03:24",
	      "refresh_period": 3600,
	      "last_refreshed": "2012-07-09 03:03:24",
	      "title": "In use with api_key only!",
	      "description": "In use with api_key only!",
	      "created": "2012-07-09 03:02:53",
	      "modified": "2012-07-09 03:03:24",
	      "start_date_parsed": "2012-07-05 03-03-24",
	      "end_date_parsed": "2012-07-09 03-03-24"
	    }
	  }
	}
	
At the time when created this filter returned only 12 news.	
	Filter news containing person "Barack Obama". We support "PersonDisambiguated" and "Person" Filter models.
	Always choose a Disambiguated if available for better results. "PersonDisambiguated" would group filter models "Person" with names: "Barack Obama", "Obama", "Barack H. Obama" and others under single ID.

Barack Obama News Filter example

First get the ID for Filter Model "PersonDisambiguated" with name "Barack Obama":

Request:
	curl http://www.semanticwire.com/api/v2.1/library/PersonDisambiguated.json -x POST -d '
	{
		"conditions": {
			"name" : "Barack Obama"
		}
	}'
	

Response:
	{
	  "status": "ok",
	  "messages": [],
	  "cache": {
	    "use_cache": 1,
	    "expires": "2012-07-12 03:08:50",
	    "last_modified": "2012-07-09 03:08:50",
	    "request_date": "2012-07-09 03:08:50"
	  },
	  "meta": {
	    "content_type": "text/plain; charset=UTF-8",
	    "server_addr": "192.168.0.123",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "POST",
	    "request_time": 1341817720,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "www.semanticwire.com",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "71.68.41.160"
	  },
	  "pagination": {
	    "sort": null,
	    "direction": null
	  },
	  "data": [
	    {
	      "PersonDisambiguated": {
	        "id": "16805",
	        "name": "Barack Obama",
	        "news_score": "29433"
	      }
	    }
	  ]
	}


Filter Model PersonDisambiguated with name "Barack Obama" has ID: 16805

Now make the Filter Call:
Request:
	curl http://www.semanticwire.com/api/v2.1/filters.json -x POST -d '
	{
		"Filter": {
			"start_date": "-4 days",
			"end_date": "now",
			"conditions": {
				"and": {
					"PersonDisambiguated": [
						{"id": 16805}
					]
				}
			}
		}
	}'

Response:
{
  "status": "ok",
  "messages": {
    "ok": [
      "Filter has been created."
    ]
  },
  "cache": {
    "use_cache": 0,
    "expires": "2012-07-09 03:12:11",
    "last_modified": "2012-07-09 03:12:11",
    "request_date": "2012-07-09 03:12:11"
  },
  "meta": {
    "content_type": "text/plain; charset=UTF-8",
    "server_addr": "192.168.0.123",
    "server_protocol": "HTTP/1.1",
    "request_method": "POST",
    "request_time": 1341817931,
    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
    "http_accept_charset": "N/A",
    "http_accept_encoding": "gzip, deflate",
    "http_host": "www.semanticwire.com",
    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
    "remote_addr": "71.68.41.160"
  },
  "pagination": [],
  "data": {
    "Filter": {
      "id": "4ffa844b-52d8-4edd-b950-40bfc0a8007b",
      "filter_hash": "532982e9f08ca906e7fbcf078b42ec29",
      "parent_id": [],
      "status": "OK",
      "start_date": "-4 days",
      "end_date": "now",
      "conditions": {
        "and": {
          "PersonDisambiguated": [
            {
              "id": 16805
            }
          ]
        }
      },
      "document_count": 3140,
      "parent_document_count": 0,
      "refresh_date": "2012-07-09 04:12:11",
      "refresh_period": 3600,
      "last_refreshed": "2012-07-09 03:12:11",
      "title": "In use with api_key only!",
      "description": "In use with api_key only!",
      "created": "2012-07-09 03:12:11",
      "modified": "2012-07-09 03:12:11",
      "start_date_parsed": "2012-07-05 03-12-11",
      "end_date_parsed": "2012-07-09 03-12-11"
    }
  }
}

Tag document_count from returned data shows there are 3140 filtered news at time of the filtering.	
All Entity Filter Models support an optional Relevance Condition. The relevance shows how important the target entity is for the news content.
It scales from 0 to 100. Entity with sore more then 20 play important role in the news. 
By setting Relevance Condition you would target news who have or don't have Entity ID with the right relevance.
Relevance Condition is set by adding "min_relevance" or "max_relevance" tags with in the Filter Model tag.

Example:
	Previous "Barack Obama" Filter but now with minimum relevance 25. This way "Barack Obama" is not only mentioned in the news.

News with big relevance to Barack Obama Filter example

We found from the previous example the ID for Filter Model "PersonDisambiguated" with name "Barack Obama" to be 16805.

Now make the Filter Call:
Request:
	curl http://www.semanticwire.com/api/v2.1/filters.json -x POST -d '
	{
		"Filter": {
			"start_date": "-4 days",
			"end_date": "now",
			"conditions": {
				"and": {
					"PersonDisambiguated": [
						{"id": 16805, "min_relevance": 25}
					]
				}
			}
		}
	}'

Response:
	{
	  "status": "ok",
	  "messages": {
	    "ok": [
	      "Filter has been created."
	    ]
	  },
	  "cache": {
	    "use_cache": 0,
	    "expires": "2012-07-09 03:25:31",
	    "last_modified": "2012-07-09 03:25:31",
	    "request_date": "2012-07-09 03:25:31"
	  },
	  "meta": {
	    "content_type": "text/plain; charset=UTF-8",
	    "server_addr": "192.168.0.123",
	    "server_protocol": "HTTP/1.1",
	    "request_method": "POST",
	    "request_time": 1341818731,
	    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
	    "http_accept_charset": "N/A",
	    "http_accept_encoding": "gzip, deflate",
	    "http_host": "www.semanticwire.com",
	    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
	    "remote_addr": "71.68.41.160"
	  },
	  "pagination": [],
	  "data": {
	    "Filter": {
	      "id": "4ffa876b-aa44-4232-9e49-3c27c0a8007b",
	      "filter_hash": "199ee6fd697963cee759bbf5c5227c5c",
	      "parent_id": [],
	      "status": "OK",
	      "start_date": "-4 days",
	      "end_date": "now",
	      "conditions": {
	        "and": {
	          "PersonDisambiguated": [
	            {
	              "id": 16805,
	              "min_relevance": 25
	            }
	          ]
	        }
	      },
	      "document_count": 2298,
	      "parent_document_count": 0,
	      "refresh_date": "2012-07-09 04:25:31",
	      "refresh_period": 3600,
	      "last_refreshed": "2012-07-09 03:25:31",
	      "title": "",
	      "description": "",
	      "created": "2012-07-09 03:25:31",
	      "modified": "2012-07-09 03:25:31",
	      "start_date_parsed": "2012-07-05 03-25-31",
	      "end_date_parsed": "2012-07-09 03-25-31"
	    }
	  }
	}

Tag document_count from returned data shows there are 2298 filtered news. There were 3140 filtered news without the relevance condition.	
You can mix all the Condition Rules ("and", "or" and "not") and all the Filter Models ("Topic", "Currency", "Organization", "ManMadeDisaster" ...).
Complex Filter example:
Target news with conditions:
	Published: with in last week.
	Have Topic: "Politics" but do not have topic "War Conflict"
	Have People: ( Have at least one of: 'David Cameron' or 'Hillary Clinton' ) and 'Ban Ki-moon'
	Have City: 'London, United Kingdom' and 'London' has good relevance to the news.
	Do not have Organization 'European Central Bank'.

Make the Filter Call

First find all the IDs needed for creating the conditions for the filter Call:

Calls needed:
	curl http://www.semanticwire.com/api/v2.1/library/Topic.xml
	
	curl http://www.semanticwire.com/api/v2.1/library/PersonDisambiguated.json -X POST -d '
	{
		"conditions": {
			"name": "David Cameron"
		}
	}'
	
	curl http://www.semanticwire.com/api/v2.1/library/PersonDisambiguated/limit:2.json -X POST -d '
	{
		"conditions": {
			"name": "Ban Ki%"
		}
	}'
	
	curl http://www.semanticwire.com/api/v2.1/library/CityDisambiguated/limit:3.json -X POST -d '
	{
		"conditions": {
			"name": "London%"
		}
	}'
	
	curl http://www.semanticwire.com/api/v2.1/library/Organization/limit:3.json -X POST -d '
	{
		"conditions": {
			"name": "European Central%"
		}
	}'

	


Now make the filter call
Request:
	curl http://www.semanticwire.com/api/v2.1/filters.json -X POST -d '
	{
		"Filter": {
			"start_date": "-1 week",
			"end_date": "now",
			"conditions": {
				"and": {
					"CityDisambiguated": [
						{"id": 10, "min_relevance": 15}, {"id": 4}
					]
				},
				"or": {
					"PersonDisambiguated": [
						{"id": 16684}, {"id": 44741}
					]
				},
				"not": {
					"Topic": [
						{"id": 7}
					],
					"Organization": [
						{"id": 2111}
					]
				}
			}
		}
	}'
		

Every filter has an id attribute. The Filter ID can be obtained from the retuned data when making a filter call.
Filter ID from previously created filter can be used as parent_id for next filter.
Filters created with parent_id will have input from its parent(s).
This same Filter can be created with only one condition at a time using nested filters.

Example on filter with parent_id:
	curl http://www.semanticwire.com/api/v2.1/filters.json -X POST -d '
	{
		"Filter": {
			"parent_id": ["4ffa8c52-9214-48ae-b662-3c27c0a8007b"],
			"conditions": {
				"and": {
					"CityDisambiguated": [
						{"id": 10}
					]
				}
			}
		}
	}'

Other Filter Endpoints:

Endpoint: GET /api/v2.1/filters/{API_KEY}/[Pagination][Extension] Description: List filters for API Key Endpoint: GET /api/v2.1/filters/{Filter_id}/[API_KEY][Extension] Description: View filter by ID. Endpoint: PUT /api/v2.1/filters/{Filter_id}/{API_KEY}[Extension] Description: Edit filter. Changes to current filter need to be send via PUT. Endpoint: DELETE /api/v2.1/filters/{Filter_id}/{API_KEY}[Extension] Description: Delete one filter.

Filter Models (What to filter by)


General Filter Models:

Filter Model:Description:
TopicTopics attempt to identify the "aboutness" of the submitted content input - the topic or topics that the content discusses. It is possible that more than one topic will be assigned to the input content, or that no topics will be assigned.
TagTags attempt to emulate how a person would tag a specific piece of content. For example, if you submit a story about Barack Obama and a piece of legislation – at least one reasonable tag would be “U.S. legislation”. A story about the relative merits of BMWs, Ferraris and Porsches should probably be tagged “sports cars” and “luxury makes” as well as "auto racing" and "motorsport".
SubdomainShows the source of publication ( subdomain name ).

Entity Filter Models:

Filter Model:Description:
AnniversaryExtracts a reference to an anniversary.
CityExtracted name of a city or independent settlement (including villages, settlements, etc.) Note: Districts or neighborhoods within a city (e.g., "in the Soho, London") are not extracted.
CityDisambiguatedDisambiguated city name.
CompanyExtracts a full or partial company name (the term "Company" includes any business organization, including newspapers, media companies, law firms, etc.). The name is normalized to the fullest name occurring withi
CompanyDisambiguatedDisambiguated company name.
ContinentExtracts a name of a continent.
CountryExtracts a name of a country, normalized to the fullest name occurring within the document.
CountryDisambiguatedDisambiguated country name.
CurrencyExtracts a reference to a currency.
DateDate
ElectronicDisambiguatedDisambiguated product name of type Electronics.
EmailAddressAn email address.
EntertainmentAwardEventExtracts references to entertainment-related events and awards, such as film and music festivals and awards related to the entertainment industry.
FacilityExtracts a proper name of a man-made, specific structure or a group of structures that provide(s) a particular service or is(are) used for a particular industry.
FaxNumberExtracts a full fax number, including prefix and extension, if available.
HolidayExtracts references of holidays.
IndustryTermExtracts a description of an industry, segment, product family, or business.
MarketIndexExtracts a name of a stock market index. The name is normalized to the common name of the index, e.g., "S&P 500" or "FTSE 100".
MedicalConditionExtracts references to human medical conditions, such as diseases, disorders and syndromes.
MedicalTreatmentExtracts references to medical treatments - procedures, treatments and therapeutics provided to any medical condition.
MovieExtracts references to movies and films.
MusicAlbumExtracts references to music albums, CDs, etc.
MusicGroupExtracts references to music groups and bands.
NaturalFeatureExtracts a name of a specific geographical (not manmade) entity, such as a geological formation or body of water.
OperatingSystemExtracts references to operating systems.
OrganizationExtracts a full or partial organization name, including governmental and military organization. Any business organization extracted as Company is not extracted as Organization. The name is normalized to the fullest name occurring within the document, or to the full, official name listed within the Organization dictionary (whichever is longer).
PersonExtracts one of the following types of person references in the text: 1. A full or partial person name. 2. A full or partial person name with aliases, nicknames or tribal names. In such cases, the normalized name includes the alias/nickname/tribal name inside quotes or parentheses at the middle or end of the name, according to its appearance in the document. If there is a sequence of two aliases for the same person, they appear with a "/" between them. If the alias/nickname/tribal name appears by itself later in the document, it will also be extracted. 3. Anaphora of the form he/she/his/him/her, which refers to a person name previously mentioned in the document. The IM resolves the anaphora and extracts it with the relevant person name. In each case, the name is normalized to the fullest name occurring in the document. Note: The event/fact PersonDetails also extracts a full or partial person name, along with position, affiliation and other person details. If the Person instance includes ONLY the name and no affiliation, the PersonDetails instance will NOT be extracted, ONLY the Person instance will be extracted.
PersonDisambiguatedThe name with which a person is commonly referred by.
PhoneNumberExtracts a full phone number, including prefix and extension, if available.
PoliticalEventExtracts references to political events.
PositionExtracts information concerning position that a person holds, will hold, or held.
ProductThe entity type extracts references to products. The product type is extracted for the following product types: drug products, electronic products, car models, aircraft models, and weapons.
ProgrammingLanguageExtracts references to programming languages.
ProvinceOrStateExtracts the name of a province, state or county or other politically defined part of a country (normalized to the full name).
ProvinceOrStateDisambiguatedDisambiguated province or state name.
PublishedMediumExtracts references to published media, such as newspapers, journals and magazines.
RadioProgramExtracts references to radio programs.
RadioStationExtracts references to radio stations. This entity type is currently focused on U.S. radio stations, although it may identify non-U.S. stations as well.
RegionExtracts a name of a (non-politically defined) geographical region of theworld (excluding continents).
SportsEventExtracts references to sports-related tournaments and championships.
SportsGameExtracts references to sports games like football, baseball, soccer, etc.
SportsLeagueExtracts names of sports leagues. Note that some sports leagues may also be extracted as organizations.
TechnologyExtracted technology name or a description of the technology.
TVShowExtracts references to TV shows and programs.
TVStationExtracts references to TV stations. This entity type is currently focused on U.S. TV stations, although it may identify non-U.S. stations as well.
URLExtracts a URL or FTP address.

Action Filter Models:

Filter Model:Description:
ManMadeDisasterExtracts references to disasters and incidents that originate in non-natural processes such as fires, nuclear disasters, oil spills and explosions.
CompanyReorganizationExtracts references to the event of corporate reorganization/restructuring.
QuotationExtracts quotes from people.
MergerExtracts a reference to a merger transaction (past, present or future). May also be extracted from the document title.
DiplomaticRelationsExtracts information about diplomatic relations between diplomatic entities (i.e., countries, governments, minority groups, regions, international organizations or a person who is a spokesperson for a group).
PersonCommunicationExtracts references to communications (meetings, phone calls or direct verbal communication) between two or more people or groups of people. The references are to communication/meetings that actually took place, alleged to have taken place, or planned communication/meetings. The persons may be referred to by their actual explicit names (i.e., proper names) or by a description, or rarely by their organization or facility.
CompanyAffiliatesExtracts references to a parent company or subsidiary relationship between two companies.
ProductIssuesExtracts information concerning problems found in products. It may also extract information about product issues where no specific product is mentioned if the company is identified.
ProductRecallExtracts references to recall of products.
EmploymentChangeExtracts an announcement about a recent appointment, retirement (including dismissal) or promotion of an executive (or several executives) in a company or organization. May also be extracted from the document title.
PoliticalEndorsementExtracts information about endorsements between parties, people or lobbies.
NaturalDisasterExtracts references to natural disasters – e.g., hurricanes, earthquakes, floods - occurring anywhere in the world.
PersonTravelExtracts references to past, present or future travel of people, from one concrete place (origin) to another (destination).
FDAPhaseExtracts mentions of FDA phases for drugs - the stage in the US Food and Drug Administration’s approval process.
PoliticalRelationshipExtracts a reference to a mentioned relation between two political entities, such as political parties, people or lobbies. These relationships can be of two types: 'alliance' or 'rivalry'. Note: Endorsment relationships are not extracted.
BankruptcyExtracts references to bankruptcy issues that involve companies: Corporate insolvencies and bankruptcies, where a company has filed for bankruptcy or been declared insolvent. Voluntary and involuntary insolvency proceedings including creditor protection actions such as Chapter 11 federal bankruptcy code proceedings in the U.S. and administration orders elsewhere as well receiverships. Company ceasing trading, bankruptcy court rulings and a company's emergence from a bankruptcy protection or administration process.
PollsResultExtracts information about results of a vote, received in a poll.
ExtinctionExtracts references to an animal/plant life almost ceasing to exist.
EnvironmentalIssueExtracts instances of an issue having an effect on the environment at any particular location or on a particular date.
CompanyLaborIssuesExtracts production stoppages brought about by labor disagreements, negotiations etc.
IndictmentExtracts references to an indictment of a person or group of people (charged with criminal offenses).
ConvictionExtracts references to a conviction of an individual or group of people.
ArrestExtracts references to the arrest of a person or a group of persons.
BusinessRelationExtracts a reference to a business agreement, signed recently or in the past, between two or more companies. Note: Agreements phrased as "alliances" or "partnerships" are extracted as an Alliance. "Weaker" contacts are extracted as a BusinessRelation.
TrialExtracts references to the trial of a person or group of people.
MovieReleaseExtracts references to movie releases (past, present or future) or mentions of new movies.
AllianceExtracts a reference to an alliance agreement signed recently, or in the past, between two or more companies.
ProductReleaseExtracts references to a company releasing a product including the release status.
VotingResultExtracts information about results of a vote.
DividendExtracts information about dividends paid to shareholders by a company.
AcquisitionExtracts a reference to an acquisition (in the past, present or future) of shares in a company or of assets of another company. May also be extracted from the document title.
CompanyExpansionExtracts two types of company expansion: a company entering a new market, and a company creating a new unit.
CompanyInvestmentExtracts references to an investment in one company by another company.
CompanyLayoffsExtracts references to an event of a company reducing its workforce by cutting the number of employees, jobs, positions, etc.
IPOExtracts references to an Initial Public Offering (IPO) of stock by a company.
DelayedFilingExtracts references to a delay in filing reports by a company.
CompanyForceMajeureExtracts interruption of regular activity in a company due to unexpected external events.
CompanyEarningsAnnouncementExtracts references to an official announcement, made by the publicly traded company itself, regarding its financial earnings results. May also be extracted from the document title.
MusicAlbumReleaseExtracts references to music album releases (past, present or future) or mentions of new music albums.
BuybacksExtracts references to a company’s plan to repurchase its own securities in the open market (buyback events).
CompanyLegalIssuesExtracts references to one of the following legal issues that involve a company: Class Action: A legal action against a company or companies where an individual represents a group in a court claim. Corporate Litigation: Lawsuits/Litigation involving corporate entities that can have a material effect on the future actions/finances of the companies involved.
AnalystEarningsEstimateExtract reports about estimates given by external analysts regarding the future (i.e., not-yet-reported) financial results of a publicly-traded company.
AnalystRecommendationExtracts references to a recommendation by an analyst (of an investment bank or similar organization) regarding shares of a publicly traded company. The recommendation should be regarding shares (equity) only. Any recommendation regarding bonds or other credit instruments is not extracted by this concept. May also be extracted from the document title.
SecondaryIssuanceExtracts references to stockissuances by companies, which aren't initial issuances. (Initial issuance of stock is extracted by the IPO event/fact.)
JointVentureExtracts a reference to a joint-venture agreement, signed recently or in the past. May also be extracted from the document title.
PatentFilingExtracts references to companies or organizations filing for patent registration and information about the patent.
CompanyNameChangeExtracts references to the event of changing the name of a company.
CompanyListingChangeExtracts a reference to any change in listing for a company in any known stock exchange, i.e., companies added or removed from any one of the stock exchanges.
CompanyEarningsGuidanceExtracts references to a projected earnings, made by the publicly traded company itself.
CompanyMeetingExtracts references to a shareholders’ meeting held by a company.
DebtFinancingExtracts Debt Financing information from the finance related documents
CompanyUsingProductExtract references to customer companies or organizations using products of provider companies. The product can be either product name or product description.
ConferenceCallExtracts references to conference calls (in the past, present or future) held by a company, usually to report their financial results for the latest period.
PatentIssuanceExtracts references to patents being issued/granted for comanies or organizations who filed them. It also includes information about the issued patents.
StockSplitExtracts references to a stock split declared by a company.
CompanyAccountingChangeExtracts references to a company's change in its accounting method or policy, i.e., change of fiscal year, change of depreciation policy or new accounting standards.
BonusSharesIssuanceExtracts references to bonus shares issues (in the past, present or future).
CompanyRestatementExtracts references to a company restatement of its financial statement for some period(s).
EquityFinancingExtracts information pertaining to equity financing (usually secondary issuance of the securities or new issuance of other stocks).
IndicesChangesExtracts references change in any individual financial index, i.e., companies added or removed from one of the indices. An index change should only be noted if the company is being removed for lack of presentation and not because of a merger/acquisition transaction.
ArmedAttackExtracts information referring to any attack by a country or an organization, or an attack on a leader or political figure.
ArmsPurchaseSaleExtracts references to an arms deal.
CandidatePositionExtracts information about political election (current or past) candidates (including mayoral) and their positions: aspirations as well as current and past positions.
MilitaryActionExtracts references to non-combative action taken by the military.

Document Filter Model:

Filter Model:Description:
DocumentUsed to specify a news from the database.
DocumentGroup(temporarily restricted!).

Library

Overview:	
	Used to find the ID of an entity from a Filter Model.
	
Call Format:
	GET /api/v2.1/library/{FilterModel}/[Pagination]/[API_KEY]{Extension}
( List paginated result of all FilterModel ordered by news_score )

Call Format:
	POST /api/v2.1/library/{FilterModel}/[Pagination]/[API_KEY].{Extension}
( Return only FilterModels who match posted conditions )
Posted JSON have format:
{
	"conditions": {
		"name":"TheNameYouSearchFor"
	}
}

Pagination defaults: 
	limit:20/page:1/direction:desc/sort:news_score/count:0

Pagination sort options: 
	news_score - shows a score on how often the entity is found in the news. Updates once a week.
	
FilterModel could be one of Tag, Topic, Subdomain, and all entity Filter Models.
Full list:
Anniversary, City, CityDisambiguated, Company, CompanyDisambiguated, Continent, Country, CountryDisambiguated, Currency, ElectronicDisambiguated, EmailAddress, EntertainmentAwardEvent, Facility, FaxNumber, Holiday, IndustryTerm, MarketIndex, MedicalCondition, MedicalTreatment, Movie, MusicAlbum, MusicGroup, NaturalFeature, OperatingSystem, Organization, Person, PersonDisambiguated, PhoneNumber, PoliticalEvent, Position, Product, ProgrammingLanguage, ProvinceOrState, ProvinceOrStateDisambiguated, PublishedMedium, RadioProgram, RadioStation, Region, Subdomain, SportsEvent, SportsGame, SportsLeague, Tag, Technology, Topic, TVShow, TVStation, URL
	
Examples: 
curl http://www.semanticwire.com/api/v2.1/library/Topic.xml

curl http://www.semanticwire.com/api/v2.1/library/PersonDisambiguated.json -X POST -d '
{
	"conditions": {
		"name": "David Cameron"
	}
}'

curl http://www.semanticwire.com/api/v2.1/library/PersonDisambiguated/limit:2.json -X POST -d '
{
	"conditions": {
		"name": "Ban Ki%"
	}
}'

curl http://www.semanticwire.com/api/v2.1/library/CityDisambiguated/limit:3.json -X POST -d '
{
	"conditions": {
		"name": "London%"
	}
}'

curl http://www.semanticwire.com/api/v2.1/library/Organization/limit:3.json -X POST -d '
{
	"conditions": {
		"name": "European Central%"
	}
}'

Geo Search:

Models CityDisambiguated, ProvinceOrStateDisambiguated and CountryDisambiguated can be search by coordinates.
To search by coordinates you must post data conditions with latitude, longitude and radius.


Example:
	To find all cities on 50 miles in radius of New York:
		1. Get the latitude and longitude of New York
			
			curl http://www.semanticwire.com/api/v2.1/library/CityDisambiguated/limit:1.json -x POST -d '
			{
				"conditions":{
					"name": "New York%"
				}
			}'
			{
			  "status": "ok",
			  ........
			  "data": [
			    {
			      "CityDisambiguated": {
			        "id": "6",
			        "name": "New York City,New York,United States",
			        "news_score": "41038",
			        "shortname": "New York City",
			        "contained_by_state_id": "27",
			        "contained_by_country_id": "1",
			        "latitude": "40.7142",
			        "longitude": "-74.0064",
			        "contained_by_state": "New York",
			        "contained_by_country": "United States"
			      }
			    }
			  ]
			}
		2. Get the cities around New York:
		
			curl http://www.semanticwire.com/api/v2.1/library/CityDisambiguated/limit:1.json -x POST -d '
			{
				"conditions":{
					"latitude": "40.7142",
					"longitude": "-74.0064",
					"radius": 50
				}
			}'
			{
			  "status": "ok",
			  	...
				...
				...
			  "data": [
			    {
			      "CityDisambiguated": {
			        "id": "6",
			        "name": "New York City,New York,United States",
			        "news_score": "41038",
			        "shortname": "New York City",
			        "contained_by_state_id": "27",
			        "contained_by_country_id": "1",
			        "latitude": "40.7142",
			        "longitude": "-74.0064",
			        "contained_by_state": "New York",
			        "contained_by_country": "United States",
			        "distance": "8.34296866273147e-05"
			      }
			    },
			    {
			      "CityDisambiguated": {
			        "id": "42903",
			        "name": "South Brooklyn,New York,United States",
			        "news_score": "1",
			        "shortname": "South Brooklyn",
			        "contained_by_state_id": "27",
			        "contained_by_country_id": "1",
			        "latitude": "40.684",
			        "longitude": "-73.9954",
			        "contained_by_state": "New York",
			        "contained_by_country": "United States",
			        "distance": "2.16498258770735"
			      }
			    },
				......
				......
				......
			    {
			      "CityDisambiguated": {
			        "id": "23367",
			        "name": "Guttenberg,New Jersey,United States",
			        "news_score": "0",
			        "shortname": "Guttenberg",
			        "contained_by_state_id": "45",
			        "contained_by_country_id": "1",
			        "latitude": "40.7939",
			        "longitude": "-74.0067",
			        "contained_by_state": "New Jersey",
			        "contained_by_country": "United States",
			        "distance": "5.5070676597649"
			      }
			    }
			  ]
			}
			


Models CityDisambiguated, ProvinceOrStateDisambiguated can be searched by the country they are contained.

	Example: To find all cities in Bulgaria:
		Find Bulgaria for model CountryDisambiguated.
			curl http://www.semanticwire.com/api/v2.1/library/CountryDisambiguated/limit:1.json -x POST -d '
			{
				"conditions":{
					"name": "Bulgaria%"
				}
			}'
		Bulgaria has ID: 134. To get cities in Bulgaria:
			curl http://www.semanticwire.com/api/v2.1/library/CityDisambiguated/limit:1.json -x POST -d '
			{
				"conditions":{
					"contained_by_country_id": 134
				}
			}'
			{
			  "status": "ok",
			  "messages": [],
			  "cache": {
			    "use_cache": 1,
			    "expires": "2012-07-12 19:01:12",
			    "last_modified": "2012-07-09 19:01:12",
			    "request_date": "2012-07-09 19:01:12"
			  },
			  "meta": {
			    "content_type": "text/plain; charset=UTF-8",
			    "server_addr": "127.0.0.1",
			    "server_protocol": "HTTP/1.1",
			    "request_method": "POST",
			    "request_time": 1341874872,
			    "http_accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
			    "http_accept_charset": "N/A",
			    "http_accept_encoding": "gzip, deflate",
			    "http_host": "site0.dev",
			    "http_user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:13.0) Gecko/20100101 Firefox/13.0.1",
			    "remote_addr": "127.0.0.1"
			  },
			  "pagination": {
			    "sort": null,
			    "direction": null
			  },
			  "data": [
			    {
			      "CityDisambiguated": {
			        "id": "184",
			        "name": "Sofia,Sofia City Province,Bulgaria",
			        "news_score": "433",
			        "shortname": "Sofia",
			        "contained_by_state_id": "0",
			        "contained_by_country_id": "134",
			        "latitude": "42.66",
			        "longitude": "23.36",
			        "contained_by_state": "Sofia City Province",
			        "contained_by_country": "Bulgaria"
			      }
			    },
				....
				....
				....
				....
			    {
			      "CityDisambiguated": {
			        "id": "21974",
			        "name": "Oryahovo,Vratsa Province,Bulgaria",
			        "news_score": "2",
			        "shortname": "Oryahovo",
			        "contained_by_state_id": "2523",
			        "contained_by_country_id": "134",
			        "latitude": "41.922",
			        "longitude": "26.1571",
			        "contained_by_state": "Vratsa Province",
			        "contained_by_country": "Bulgaria"
			      }
			    },
			    {
			      "CityDisambiguated": {
			        "id": "14568",
			        "name": "Petrich,Blagoevgrad Province,Bulgaria",
			        "news_score": "2",
			        "shortname": "Petrich",
			        "contained_by_state_id": "1955",
			        "contained_by_country_id": "134",
			        "latitude": "41.3979",
			        "longitude": "23.2076",
			        "contained_by_state": "Blagoevgrad Province",
			        "contained_by_country": "Bulgaria"
			      }
			    }
			  ]
			}
		

Model CityDisambiguated can be searched by the Province / State they are contained.












Views ( Get information out of your filter )

Documents ( Feeds )

Overview:	
	Setting up a filter will create a result 'news pool' - a number of news who match your filter conditions.
	Call to Documents View will return paginated result of all the news filtered by the previously created filter ( not grouped ).
	
Call Format:
	GET /api/v2.1/documents/{Filter_id}/[Pagination]/[API_KEY][Extension]
		
Pagination defaults: 
	limit:20/page:1/direction:desc/sort:Document.published_date/count:0

Pagination sort options: 
	Document.published_date - sort by published date.
	
Example:
	Request:
		curl http://www.semanticwire.com/api/v2.1/documents/4ffa3d00-e624-45b7-8771-9c3caa6ff6ac/limit:4.json
	Response:
		{
		  "status": "ok",
		  "messages": [],
		  	...
			...
			...
		  "data": [
		    {
		      "Document": {
		        "id": "16005813",
		        "published_date": "2012-07-09 19:10:12",
		        "subdomain_id": "7393",
		        "title": "Call for harsher driver-assault penalties",
		        "description": "BUS drivers and cabbies -- under siege after a series of violent assaults -- have been backed by Gold Coasters who say there should be tougher penalties for attackers.",
		        "url": "http://www.goldcoast.com.au/article/2012/07/10/430311_gold-coast-news.html"
		      },
		      "Subdomain": {
		        "id": "7393",
		        "name": "goldcoast.com.au",
		        "news_score": "0"
		      }
		    },
		    {
		      "Document": {
		        "id": "16005814",
		        "published_date": "2012-07-09 19:10:12",
		        "subdomain_id": "7393",
		        "title": "Coast crime, bikie violence trouble locals",
		        "description": "GOLD Coasters are afraid to walk the streets at night and two out of three say they have been victims or know somebody touched by crime.",
		        "url": "http://www.goldcoast.com.au/article/2012/07/10/430335_gold-coast-news.html"
		      },
		      "Subdomain": {
		        "id": "7393",
		        "name": "goldcoast.com.au",
		        "news_score": "0"
		      }
		    },
		    {
		      "Document": {
		        "id": "16005815",
		        "published_date": "2012-07-09 19:10:12",
		        "subdomain_id": "7393",
		        "title": "Chili Peppers tipped to play Big Day Out",
		        "description": "THE Red Hot Chili Peppers are red-hot favourites to co-headline the 2013 Big Day Out, the Gold Coast leg of the event's final year at Parklands Showgrounds, on January 20.",
		        "url": "http://www.goldcoast.com.au/article/2012/07/10/430301_gold-coast-news.html"
		      },
		      "Subdomain": {
		        "id": "7393",
		        "name": "goldcoast.com.au",
		        "news_score": "0"
		      }
		    },
		    {
		      "Document": {
		        "id": "16005816",
		        "published_date": "2012-07-09 19:10:12",
		        "subdomain_id": "7393",
		        "title": "Bank seeks possession of Surfers mansion",
		        "description": "<span>EXCLUSIVE:</span>  THE Commonwealth Bank is trying to take possession of the most expensive house sold in Surfers Paradise this year, alleging fraud by a NSW truckie's company that paid $6.75 million for the property.",
		        "url": "http://www.goldcoast.com.au/article/2012/07/10/430315_gold-coast-news.html"
		      },
		      "Subdomain": {
		        "id": "7393",
		        "name": "goldcoast.com.au",
		        "news_score": "0"
		      }
		    }
		  ]
		}


DocumentGroups

Overview:	
	Setting up a filter will create a result 'news pool' - a number of news who match your filter conditions.
	All this news could come from different sources and all sources often publish same news.
	If two or more news discuss same story they are grouped in a DocumentGroup ( News Group ). 
	DocumentGroups news will help you identify the breaking which news in your filter.
	Call to DocumentGroups View will return paginated result of all the news groups, number of news in the group and latest inserted news.
	All news with in the result groups will the filter you have previously created.
	
Call Format:
	GET /api/v2.1/document_groups/{Filter_id}/[Pagination]/[API_KEY].{Extension}
		
Pagination defaults: 
	limit:20/page:1/direction:desc/sort:document_count/count:0

Pagination sort options: 
	document_count - number of news in group.
	
Example:
	Request:
		curl http://www.semanticwire.com/api/v2.1/document_groups/50446ce6-fc50-4fae-a288-2da7c0a8007b/limit:4.json
	Response:
	{
	  "status": "ok",
	  "messages": [],
	  	...
	  "data": [
	    {
	      "DocumentGroup": {
	        "id": "147",
	        "parent_id": "0",
	        "active": "1",
	        "created": "2012-09-01 17:57:00",
	        "modified": "2012-10-09 20:19:58",
	        "document_count": "1009",
	        "total_document_count": "16616"
	      },
	      "Related": [
	        {
	          "Document": {
	            "id": "18897403",
	            "published_date": "2012-10-09 20:08:00",
	            "status": true,
	            "error": false,
	            "document_group_id": "147",
	            "subdomain_id": "15",
	            "title": "Romney Targets Obama Voters-As Polls Show Tighter Race, Gov. Tries to Peel Supporters From Pres.",
	            "description": "With new polls showing his campaign gaining momentum, Mitt Romney is venturing into what might be viewed as unfriendly territory, visiting counties in swing states that voted for President Barack Obama in 2008 and urging the president's supporters to switch sides. The strategy is crucial to the Republican nominee: With the pool of undecided voters now small, Mr. Romney's best path to building a majority includes stripping Mr. Obama of some of his more tentative supporters. "I'd like you to go out and find one person who voted for Barack Obama, or maybe two or three or four or five,...",
	            "url": "http://www.freerepublic.com/focus/f-gop/2942523/posts"
	          },
	          "Subdomain": {
	            "id": "15",
	            "domain_id": "277",
	            "name": "freerepublic.com",
	            "news_score": "11437",
	            "image": null,
	            "favicon": null,
	            "status": true,
	            "manual": "0",
	            "action": "parent",
	            "xpath": "",
	            "rss_page_url": "",
	            "refreshed": null,
	            "created": "2010-09-30 17:53:09"
	          }
	        },
	        ...
	      ]
	    },
	    {
	      "DocumentGroup": {
	        "id": "5937",
	        "parent_id": "0",
	        "active": "1",
	        "created": "2012-09-02 03:00:00",
	        "modified": "2012-10-09 20:04:15",
	        "document_count": "392",
	        "total_document_count": "1505"
	      },
	      "Related": [
	        ....

Statistics

Shows statistics on chosen Filter Model over news from your Filter
	
Call Format:
	GET /api/v2.1/statistics/{FilterModel}/{Filter_id}/[API_KEY][Extension]
	
Statistics With Condition Endpoint:
	POST /api/v2.1/statistics/{FilterModel}/{Filter_id}/[API_KEY][Extension]
	( Return only result who match posted conditions )
	Posted JSON have format:
	{
		"conditions": {
			"id":[111, 2222, 333 ...]
		}
	}
	
Pagination defaults:
	limit:20/page:1/sort:document_count/direction:desc/count:0
	
Pagination sort options: 
	document_count, sum_relevance

Filter Model can be any of the supported filter models but "Document", "DocumentGroup" and all the Action Models.



Example:
	To get statistics on Filter Model "OperatingSystem" over a previously created Filter:
	Filter ID for the example: 4ffa3d00-e624-45b7-8771-9c3caa6ff6ac
	Request:
		curl http://www.semanticwire.com/api/v2.1/statistics/OperatingSystem/4ffa3d00-e624-45b7-8771-9c3caa6ff6ac/limit:4/count:1.json
	Response:
		{
		  "status": "ok",
		  	...
			...
		  "pagination": {
		    "page": 1,
		    "pageCount": 18,
		    "current": 4,
		    "count": "70",
		    "limit": "4",
		    "prevPage": 0,
		    "nextPage": 1,
		    "sort": null,
		    "direction": null
		  },
		  "data": [
		    {
		      "OperatingSystem": {
		        "id": "3",
		        "name": "Android",
		        "news_score": "4529",
		        "document_count": "254",
		        "sum_relevance": "8487"
		      }
		    },
		    {
		      "OperatingSystem": {
		        "id": "8",
		        "name": "Microsoft Windows",
		        "news_score": "2738",
		        "document_count": "176",
		        "sum_relevance": "7452"
		      }
		    },
		    {
		      "OperatingSystem": {
		        "id": "85",
		        "name": "Poseidon",
		        "news_score": "31",
		        "document_count": "105",
		        "sum_relevance": "1923"
		      }
		    },
		    {
		      "OperatingSystem": {
		        "id": "15",
		        "name": "Windows 7",
		        "news_score": "559",
		        "document_count": "35",
		        "sum_relevance": "1062"
		      }
		    }
		  ]
		}
		
		
		
		
Result from statistics can be filtered by sending the ids on FilterModel you are requesting as a condition.
If you are only interested in statistics for 'Cancer', 'Diabetes' and 'HIV' you can get their IDs with a library call and make a statistics call with condition:

Example 'Diabetes' vs 'Cancer' vs 'HIV' in your filter:
	
	Request:
		curl http://www.semanticwire.com/api/v2.1/statistics/MedicalCondition/4ffa3d00-e624-45b7-8771-9c3caa6ff6ac.json -x POST -d '
		{
			"conditions": {
				"id": [12,6,53]
			}
		}'
	Response:
		{
		  "status": "ok",
		  	...
			...
			...
		  "data": [
		    {
		      "MedicalCondition": {
		        "id": "12",
		        "name": "cancer",
		        "news_score": "4104",
		        "document_count": "288",
		        "sum_relevance": "9607"
		      }
		    },
		    {
		      "MedicalCondition": {
		        "id": "6",
		        "name": "Diabetes",
		        "news_score": "1822",
		        "document_count": "102",
		        "sum_relevance": "3347"
		      }
		    },
		    {
		      "MedicalCondition": {
		        "id": "53",
		        "name": "HIV",
		        "news_score": "845",
		        "document_count": "49",
		        "sum_relevance": "2512"
		      }
		    }
		  ]
		}



Time Line

	Shows time line of the news your filter gets per day.
	Since the number published news depends on the day of the week ( Monday much more news published then Sunday ), holidays, submitting new sources to the system or other factors, we find time line activity to be best presented as percent of all news for the day.
	
Time Line Call format:	
	/api/v2.1/timeline/{Filter_id}/[API_KEY][Extension]
	
Pagination is not supported.


Example: 
	Timeline on previously created filter with last week and Topic: Disaster Accident.
	The filter id is: 4ffb72cc-24c4-4a5a-99b5-4591c0a8007b
	
	Request:
		curl http://www.semanticwire.com/api/v2.1/timeline/4ffb72cc-24c4-4a5a-99b5-4591c0a8007b.json
	Response:
		{
		  "status": "ok",
		  	...
			...
		  "data": [
		    {
		      "Day": {
		        "date": "2012-07-02",
		        "min_published_date": "2012-07-02 20:10:00",
		        "max_published_date": "2012-07-02 23:59:31",
		        "document_count": 205,
		        "total_document_count": 3427
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-07-03",
		        "min_published_date": "2012-07-03 00:00:00",
		        "max_published_date": "2012-07-03 23:58:00",
		        "document_count": 1633,
		        "total_document_count": 29605
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-07-04",
		        "min_published_date": "2012-07-04 00:00:00",
		        "max_published_date": "2012-07-04 23:58:00",
		        "document_count": 1352,
		        "total_document_count": 26474
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-07-05",
		        "min_published_date": "2012-07-05 00:00:00",
		        "max_published_date": "2012-07-05 23:59:00",
		        "document_count": 1564,
		        "total_document_count": 29297
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-07-06",
		        "min_published_date": "2012-07-06 00:00:00",
		        "max_published_date": "2012-07-06 23:56:00",
		        "document_count": 1372,
		        "total_document_count": 27908
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-07-07",
		        "min_published_date": "2012-07-07 00:00:00",
		        "max_published_date": "2012-07-07 23:59:00",
		        "document_count": 1102,
		        "total_document_count": 15927
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-07-08",
		        "min_published_date": "2012-07-08 00:00:00",
		        "max_published_date": "2012-07-08 23:57:00",
		        "document_count": 996,
		        "total_document_count": 17183
		      }
		    },
		    {
		      "Day": {
		        "date": "2012-07-09",
		        "min_published_date": "2012-07-09 00:00:00",
		        "max_published_date": "2012-07-09 19:31:00",
		        "document_count": 1041,
		        "total_document_count": 19968
		      }
		    }
		  ]
		}



Actions

	Shows extracted actions of the news in your filter.
	
Time Line Call format:	
	/api/v2.1/actions/{ActionModel}/{Filter_id}/[API_KEY][Extension]

ActionModel is one of Actions Filter Models ( see Filter Models ).

Pagination defaults:
	limit:20/page:1/sort:document_count/direction:desc/count:0

Pagination sort options: 
	document_count

	Example: 
		Actions on previously created filter with last week and Topic: Disaster Accident.
		The filter id is: 4ffb72cc-24c4-4a5a-99b5-4591c0a8007b

		Request:
			curl http://www.semanticwire.com/api/v2.1/actions/ManMadeDisaster/4ffb72cc-24c4-4a5a-99b5-4591c0a8007b.json
		Response:
			{
			  "status": "ok",
			  	...
				...
				...
			  "data": [
			    {
			      "ManMadeDisaster": {
			        "id": "274",
			        "document_count": "147",
			        "created": "2010-10-01 02:21:50",
			        "total_document_count": "1566",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "ProvinceOrState": {
			                  "id": "41",
			                  "name": "Colorado",
			                  "news_score": "4730"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "258",
			        "document_count": "63",
			        "created": "2010-10-01 02:21:50",
			        "total_document_count": "3777",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "Country": {
			                  "id": "1",
			                  "name": "United States",
			                  "news_score": "115527"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "51944",
			        "document_count": "51",
			        "created": "2011-06-20 03:31:40",
			        "total_document_count": "523",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "8904802",
			                  "name": "the High Park"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "43618",
			        "document_count": "45",
			        "created": "2011-06-04 18:00:33",
			        "total_document_count": "84",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "5147853",
			                  "name": "Western states"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "223963",
			        "document_count": "40",
			        "created": "2012-07-05 04:02:36",
			        "total_document_count": "48",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "38",
			              "name": "date",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "16777215",
			                  "name": "the increase had a large negative impact on student enrollment"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "4858565",
			                  "name": "Thursday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "223574",
			        "document_count": "37",
			        "created": "2012-07-04 12:55:39",
			        "total_document_count": "39",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "52",
			              "name": "effect",
			              "name_nice": "Effect",
			              "description": null
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "16777215",
			                  "name": "the increase had a large negative impact on student enrollment"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "222785",
			        "document_count": "36",
			        "created": "2012-07-03 04:08:59",
			        "total_document_count": "57",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "38",
			              "name": "date",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "16777215",
			                  "name": "the increase had a large negative impact on student enrollment"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "4918955",
			                  "name": "Tuesday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "223184",
			        "document_count": "34",
			        "created": "2012-07-04 02:32:19",
			        "total_document_count": "36",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "ProvinceOrState": {
			                  "id": "41",
			                  "name": "Colorado",
			                  "news_score": "4730"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "52",
			              "name": "effect",
			              "name_nice": "Effect",
			              "description": null
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "16777215",
			                  "name": "the increase had a large negative impact on student enrollment"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "31828",
			        "document_count": "33",
			        "created": "2011-01-14 19:31:02",
			        "total_document_count": "94",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "City": {
			                  "id": "2353",
			                  "name": "Colorado Springs",
			                  "news_score": "177"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "223270",
			        "document_count": "31",
			        "created": "2012-07-04 03:05:31",
			        "total_document_count": "41",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "38",
			              "name": "date",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "16777215",
			                  "name": "the increase had a large negative impact on student enrollment"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "5140447",
			                  "name": "Wednesday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "221350",
			        "document_count": "30",
			        "created": "2012-07-01 17:53:04",
			        "total_document_count": "74",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "38",
			              "name": "date",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "5750428",
			                  "name": "2012-07-01"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "3465473",
			                  "name": "Sunday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "224794",
			        "document_count": "25",
			        "created": "2012-07-06 08:57:41",
			        "total_document_count": "36",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "38",
			              "name": "date",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "10344525",
			                  "name": "2012-07-06"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1614789",
			                  "name": "Friday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "922",
			        "document_count": "25",
			        "created": "2010-10-01 07:13:08",
			        "total_document_count": "1326",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "4858565",
			                  "name": "Thursday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "775",
			        "document_count": "24",
			        "created": "2010-10-01 05:00:05",
			        "total_document_count": "72",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "ProvinceOrState": {
			                  "id": "64",
			                  "name": "Montana",
			                  "news_score": "1180"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "1048",
			        "document_count": "24",
			        "created": "2010-10-01 17:43:50",
			        "total_document_count": "1351",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "Country": {
			                  "id": "14",
			                  "name": "China",
			                  "news_score": "28928"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1523020",
			                  "name": "explosion"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "144",
			        "document_count": "24",
			        "created": "2010-10-01 02:21:50",
			        "total_document_count": "1406",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1614789",
			                  "name": "Friday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "34090",
			        "document_count": "23",
			        "created": "2011-04-15 17:26:41",
			        "total_document_count": "3020",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "Country": {
			                  "id": "24",
			                  "name": "Japan",
			                  "news_score": "18119"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "2847126",
			                  "name": "nuclear incident"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "39161",
			        "document_count": "23",
			        "created": "2011-05-13 13:11:38",
			        "total_document_count": "141",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "4",
			              "name": "location",
			              "name_nice": "Location",
			              "description": "Location name where certain events occurred"
			            },
			            "Entity": [
			              {
			                "ProvinceOrState": {
			                  "id": "62",
			                  "name": "Idaho",
			                  "news_score": "1165"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "120",
			        "document_count": "22",
			        "created": "2010-10-01 02:21:50",
			        "total_document_count": "1120",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "52",
			              "name": "effect",
			              "name_nice": "Effect",
			              "description": null
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "2803745",
			                  "name": "no injuries"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    },
			    {
			      "ManMadeDisaster": {
			        "id": "2429",
			        "document_count": "22",
			        "created": "2010-10-04 13:06:55",
			        "total_document_count": "1305",
			        "RelationProperty": [
			          {
			            "RelationKey": {
			              "id": "20",
			              "name": "datestring",
			              "name_nice": "Date",
			              "description": "Normalized date mentioned in text, either explicitly or relative to a DateString"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "3465473",
			                  "name": "Sunday"
			                }
			              }
			            ]
			          },
			          {
			            "RelationKey": {
			              "id": "5",
			              "name": "manmadedisaster",
			              "name_nice": "Man Made Disaster",
			              "description": "Phrase describing a man-made disaster"
			            },
			            "Entity": [
			              {
			                "Literal": {
			                  "id": "1555126",
			                  "name": "fire"
			                }
			              }
			            ]
			          }
			        ]
			      }
			    }
			  ]
			}

Code Examples

PHP Example


<?php

function makeRequest($url$method 'GET'$body null) {
    
$ch curl_init($url);
    
curl_setopt($chCURLOPT_CUSTOMREQUEST$method);

    if(
$body) {
        
curl_setopt($chCURLOPT_POSTFIELDS$body);
    }
    
curl_setopt($chCURLOPT_RETURNTRANSFER1);

    
$result_json curl_exec($ch);
    
$result_array json_decode($result_jsontrue);
    
curl_close($ch);
    return 
$result_array;
}




//Created filter array
$filter = array(
    
'Filter' => array(
        
'start_date' => '-5 Days',
        
'end_date' => 'Now'
    
)
);

//Make it json string
$body json_encode($filter);

//Send it to the server
$url "http://www.semanticwire.com/api/v2.1/filters.json";
$result makeRequest($url'POST'$body);

//output the result
$filter_id $result['data']['Filter']['id'];
$document_count $result['data']['Filter']['document_count'];
echo 
"--------------------------------------------------------------\n";
echo 
"Filter ID: $filter_id\n";
echo 
"Filtered Documents count: $document_count\n";
echo 
"--------------------------------------------------------------\n";

//Now lets find out what are top 10 Cities in that filter:
//Call statistics for Model CityDisambiguated

$url "http://www.semanticwire.com/api/v2.1/statistics/CityDisambiguated/$filter_id/limit:10.json";
$result makeRequest($url'POST'$body);


echo 
"---- TOP CITIES FOR THE FILTER ----\n";

foreach(
$result['data'] as $city) {
    echo 
$city['CityDisambiguated']['name'] . "\n";
}


//Lets change the filter to have only news who have CountryDisambiguated: "China" in them.
//Find the ID for China

$url "http://www.semanticwire.com/api/v2.1/library/CountryDisambiguated/limit:1.json";
$filter = array("conditions" => array('name' => 'China%'));
$body json_encode($filter);
$result makeRequest($url'POST'$body);
$china_id $result['data'][0]['CountryDisambiguated']['id'];

//Created filter array with same time frame but extra condition CountryDisambiguated:China and some relevance
//We could have used the previous Filter ID as parent_id
$filter = array(
    
'Filter' => array(
        
'start_date' => '-5 Days',
        
'end_date' => 'Now',
        
'conditions' => array(
            
'and' => array(
                
'CountryDisambiguated' => array(
                    array(
'id' => $china_id'min_relevance' => 20)
                )
            )
        )
    ),
);
$body json_encode($filter);
$url "http://www.semanticwire.com/api/v2.1/filters.json";
$result makeRequest($url'POST'$body);
$filter_id $result['data']['Filter']['id'];
$document_count $result['data']['Filter']['document_count'];

echo 
"----      Filter with news who contain country China       ---\n";
echo 
"Filter ID: $filter_id\n";
echo 
"Filtered Documents count: $document_count\n";
echo 
"--------------------------------------------------------------\n";

//Now lets find out what are top 10 Cities in the new China filter:
$url "http://www.semanticwire.com/api/v2.1/statistics/CityDisambiguated/$filter_id/limit:10.json";
$result makeRequest($url'POST'$body);

echo 
"---- TOP CITIES FOR THE NEW CHINA FILTER ----\n";

foreach(
$result['data'] as $city) {
    echo 
$city['CityDisambiguated']['name'] . "\n";
}

?>

JQuery Examples

 
  

Get in touch
Contact Us Form
Email: admin [at] semanticwire.com