BrightCloud's Hosted Internet Security Service provides access to the largest, most accurate, and most up to date repository of categorized Web sites in the industry. It is a URL content and security classification service that provides access to classifications for more than 200 million URLs (and growing). It provides comprehensive, accurate, and up to date URL classifications for both the most popular and most obscure websites.
BrightCloud Web Service (BCWS) is the web interface to this most comprehensive URL classification service from BrightCloud.
Using BrightCloud Web Service, you can
The REST interface to BrightCloud Web Service is the recommended way of accessing the web service. It is more in line with the World Wide Web (www) architecture, which is true for any carefully designed REST interface. This interface uses URLs to address all the logical resources made available by the web service, and a fixed set of HTTP methods to query/add/update these resources.
Every REST request to the BrightCloud Web Service needs to be signed using a special key/secret pair. BrightCloud Web Service uses the 2-legged variation of the OAuth standard protocol for authenticating REST requests. The OAuth protocol not only uses the key/secret pair but also a timestamp and a random "nonce" value for signing the requests to provide a high degree of safety against a variety of attacks.
BrightCloud web service clients are required to generate a security string in accordance with the OAuth protocol (using their key/secret pair) for every REST request and send it in the HTTP Authorization header value in the request. A number of readymade OAuth consumer libraries are available on the internet for quite a few popular languages (including PHP, Java, Ruby, .NET) that one can use for signing the requests with minimal effort.
The key/secret pair is unique for each end user. You can generate your own key/secret pair by registering at the BrightCloud Web Services website (bcws.brightcloud.com/signup). You can find more information about this in our online article OAuth Integration for BrightCloud Web Services.
The following table lists all combinations of resources, URLs, and allowed HTTP methods that BCWS supports for it's REST interfaces.
| Resource | URL | HTTP Methods |
|---|---|---|
| URI List | http://thor.brightcloud.com/rest/uris | GET, POST |
| URI Info | http://thor.brightcloud.com/rest/uris/{URL} | GET, PUT |
| Category List | http://thor.brightcloud.com/rest/uris/Categories | GET |
Resource: Category List
URL: http://thor.brightcloud.com/rest/uris/categories
HTTP Method: GET
| Sample Request | Sample Response |
|---|---|
| GET /rest/uris/categories HTTP/1.1 HOST: thor.brightcloud.com Authorization: OAuth realm="http://thor.brightcloud.com/rest", oauth_version="1.0", oauth_nonce="dbe9e4311c72dad530b7afe47ec50ceb", oauth_timestamp="1248962133", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_token="", oauth_signature_method="HMAC-SHA1", oauth_signature="lWdn1ll3bAsKWMgpdheBvyt4bcQ%3D" |
HTTP/1.1 200 OK Transfer-encoding: chunked Content-type: text/xml < bcap > < seqnum >1< /seqnum > < response > < status >200< /status > < statusmsg >OK< /statusmsg > < categories > < cat > < catid >68< /catid > < catname >Abortion< /catname > < catgroup >Legal Liability< /catgroup > < /cat > < cat > < catid >46< /catid > < catname >Abortion- Pro Choice< /catname > < catgroup >Legal Liability< /catgroup > < /cat > . . . < /categories > < /response > < /bcap > |
Resource: URI Information
URL: http://thor.brightcloud.com/rest/uris/{URL}
HTTP Method: GET
| Sample Request | Sample Response |
|---|---|
| GET /rest/uris/www.google.com HTTP/1.1 HOST: thor.brightcloud.com Authorization: OAuth realm="http://thor.brightcloud.com/rest", oauth_version="1.0", oauth_nonce="dbe9e4311c72dad530b7afe47ec50ceb", oauth_timestamp="1248962133", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_token="", oauth_signature_method="HMAC-SHA1", oauth_signature="lWdn1ll3bAsKWMgpdheBvyt4bcQ%3D" |
HTTP/1.1 200 OK Transfer-encoding: chunked Content-type: text/xml < bcap > < seqnum >1< /seqnum > < response > < status >200< /status > < statusmsg >OK< /statusmsg > < uri >www.google.com< /uri > < categories > < cat > < catid >50< /catid > < conf >85< /conf > < /cat > < /categories > < bcri >88< /bcri > < a1cat >1< /a1cat > < /response > < /bcap > |
Resource: URI List
URL: http://thor.brightcloud.com/rest/uris
HTTP Method: GET
| Sample Request | Sample Response |
|---|---|
| GET /rest/uris HTTP/1.1 HOST: thor.brightcloud.com Authorization: OAuth realm="http://thor.brightcloud.com/rest", oauth_version="1.0", oauth_nonce="dbe9e4311c72dad530b7afe47ec50ceb", oauth_timestamp="1248962133", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_token="", oauth_signature_method="HMAC-SHA1", oauth_signature="lWdn1ll3bAsKWMgpdheBvyt4bcQ%3D" |
HTTP/1.1 200 OK Transfer-encoding: chunked Content-type: text/xml < bcap > < seqnum >1< /seqnum > < response > < status >200< /status > < statusmsg >OK< /statusmsg > < updatecdn >false< /updatecdn > < updatertu >false< /updatertu > < updatetime >2009/7/30 5:50:4< /updatetime > < cdnlist >< /cdnlist > < rtulist >< /rtulist > < /response > < /bcap > |
Resource: URI List
URL: http://thor.brightcloud.com/rest/uris
HTTP Method: POST
| Sample Request | Sample Response |
|---|---|
| POST /rest/uris HTTP/1.1 HOST: thor.brightcloud.com Content-Type: text\xml Content-Length: 80 Authorization: OAuth realm="http://thor.brightcloud.com/rest", oauth_version="1.0", oauth_nonce="dbe9e4311c72dad530b7afe47ec50ceb", oauth_timestamp="1248962133", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_token="", oauth_signature_method="HMAC-SHA1", oauth_signature="lWdn1ll3bAsKWMgpdheBvyt4bcQ%3D" < uncathits > < uri >{URL1}< /uri > < hits >{No. of hits for URL1}< /hits > < uri >{URL2}< /uri > < hits >{No. of hits for URL2}< /hits > . . . < /uncathits > |
HTTP/1.1 200 OK Transfer-encoding: chunked Content-type: text/xml < bcap > < seqnum >1< /seqnum > < response > < status >200< /status > < statusmsg >OK< /statusmsg > < /response > < /bcap > |
Resource: URI Information
URL: http://thor.brightcloud.com/rest/uris/{URL}
HTTP Method: PUT
| Sample Request | Sample Response |
|---|---|
| PUT /rest/uris/www.google.com HTTP/1.1 HOST: thor.brightcloud.com Content-Type: text\xml Content-Length: 80 Authorization: OAuth realm="http://thor.brightcloud.com/rest", oauth_version="1.0", oauth_nonce="dbe9e4311c72dad530b7afe47ec50ceb", oauth_timestamp="1248962133", oauth_consumer_key="dpf43f3p2l4k3l03", oauth_token="", oauth_signature_method="HMAC-SHA1", oauth_signature="lWdn1ll3bAsKWMgpdheBvyt4bcQ%3D" < newcats > < categories > < cat >{Category1}< /cat > < cat >{Category2}< /cat > . . . < /categories > < /newcats > |
HTTP/1.1 200 OK Transfer-encoding: chunked Content-type: text/xml < bcap > < seqnum >1< /seqnum > < response > < status >200< /status > < statusmsg >OK< /statusmsg > < /response > < /bcap > |
At this point you probably have one of two thoughts. Either you want to get setup and figure out if you can get the mechanics of this going quickly. If that's where you're at, check out our other articles on using the sample code such as our tutorial on How to use the BCWS PHP command line client. Or, if you still want to dig in a little deeper, then head back to our articles section and read to your heart's content!
If any part of this documentation is confusing or if you need additional help, please check out our forums or send us feedback. We created this for you to use, and want to make sure we're doing the best we can to provide you what you need to enable better applications!