happyou API version 2
1. Introduction
2. Query builder
3a. Request URL
3b. Request method
3c. Request parameters
3d. Response JSON document
3e. Sample Program
1. Introduction
happyou API enables you to detect updates of websites on the topic that you collect.
2.Query Builder
In Query Builder, you can build your queries and test them by filling out html form.
2a. Arguments of Query Builder
key | type | description |
---|---|---|
aid | long | unique id of article |
datelast | int | articles within n hours |
date from | date(YYYY-mm-dd) | find articles date from(inclusive) |
date to | date(YYYY-mm-dd) | find articles date to(exclusive) |
pubdatelast | int | articles published to happyou server within n hours. |
pubdatefrom | articles | articles published to happyou server from (inclusive) |
pubdateto | date(YYYY-mm-dd) | articles published to happyou server to (exclusive) |
orgname | String | organization or company name of article |
orgnamecondition | String | "match" or "contains" of orgname condition | tickersymbol or securitycode | string | ticker symbol or security code of company |
tag | string | tag conditions. tag name have to be encoded by utf-8 |
ns | string | namespace conditions. nsname have to be encoded by utf-8 |
contents | string | Full text search of articles. Work in progress. |
mode | string | "multiple conditions by using "AND" or "OR". |
count | int | maximum number of results to retrieve. Maximum value is 1000. |
sorby | string | sort result articles by |
remove external link | boolean | exclude articles which have links to external site |
minscore | int | exclude articles which have a socre less than minscore |
2b. Sample Queries
sample1. Find articles which have tag "Java" or "Scala" and published since 2015-01-01
pubdatef=2015-01-01&tag=Java+OR+Scala&mode=and&app_id=YOUR_APP_ID
sample2. Find articles which have a certain ticker symbol and published within the last 96 hours.
pubdatelast=96&tickersymbol=6502&mode=and&sortby=publisheddate&app_id=YOUR_APP_ID
3.API Specification
3a. Request URL
Format | Request URL |
---|---|
RSS | https://happyou.info/webapp2/api2/index.rss |
JSON | https://happyou.info/webapp2/api2/index.json |
3b. Request method
method | GET |
3c. Request parameters
Parameter | Type | Description |
---|---|---|
offset | int | set the start offset of this search |
count | int | Set the maximum number of reseults to retrieve. Maximum valus is 1000. |
mode | string | mutiple conditions in query. "AND" or "OR" |
aid | long | unique id of article |
orgname | String | organization name of article |
orgnamecond | String | "match" or "contains" of orgname condition |
pubdatef, pubdatet | Date | search articles publiblished between pubdatef inclusive and pubdatet exclusive. Use "yyyy-mm-dd" as date format. |
pubdatelast | int | articles published in n hours |
datef, datet | Date | search articles frozen date between datef inclusive and datet exclusive. Use "yyyy-mm-dd" as date format. |
datelast | int | articles frozen in n hours |
tag | String | tag conditions. tag name must be encoded by utf-8 |
ns | String | namespace conditions. ns name must be encoded by utf-8 |
excludeexternalsite | boolean | exclude articles which have links to external site. |
tickersymbol | string | tickersymbol or security code of the company |
3d. Response JSON document
Parameter name | occurence | type | description | |||||
---|---|---|---|---|---|---|---|---|
array | 1 | complex | root of document | |||||
articles | 1 | complex | root of articles | |||||
arary | * | array | array of (Article and it's ns) | |||||
Article | 1 | complex | single article | id | 1 | long | unique id of article | |
title | 1 | string | title | |||||
subtitle | 1 | string | subtitle | |||||
description | 1 | string | description | |||||
publishedDate | 1 | date | uploaded date to happyou.info. 'yyyy-mm-dd HH:mm:ss' in UTC time. | |||||
foundDate | 1 | date | crawled date by crawler. 'yyyy-mm-dd HH:mm:ss' in UTC time. | frozenDate | 1 | date | Date written in a title or description of article. 'yyyy-mm-dd HH:mm:ss' in UTC time. | nstitle | 1 | string | title of namespace | archivedUrl | 1 | string | source url of this article |
linkedAbsUrlList | 1 | string | list of url in an article. comma separated. | |||||
tagline | 1 | string | list of tags of an article. comma separated. | |||||
orgname | 1 | string | organization name of soruce website. | |||||
score | 1 | integer | score evaluated by crawler. | ns | 1 | complex | root of namespaces | |
array | * | array | array of namespaces | |||||
id | 1 | long | id | |||||
rieid | 1 | long | id of article | |||||
nsid | 1 | long | id of ns | |||||
val | 1 | long | value of ns | |||||
date | 1 | date | frozen date | |||||
nstitle | 1 | string | title of namespace | |||||
errorid | ? | string | error id | |||||
errormessage | ? | string | error message |
3e. Sample Program
You can download sample program to access happyou API in Java or PHP from here.
4.Webhooks
Webhooks are useful tool for integrating happyou API into your web services. happyou API triggers webhook's query periodically, generate json document which contains articles found recently and post json to your web server.
Captions | Description |
---|---|
Actions | edit/delete/test command to this webhook |
Id | id of this webhook |
Title | title of this webhook |
Url | callback URL. webhook will post json document to this URL. |
Query | query connected with this webhook. This query will be executed periodically. |
Interval | The interval time to execute query |
Last Executed | The last time this webhook executed |
On | On/Off switch of this webhook |