Content Filter API - Ruby Gem
Content Filter checks URLs against a comprehensive blocklist of 200,000+ domains categorized as ads-malware, fake news, gambling, adult content, or social media. Returns the specific category for blocked domains.
Installation
Add this line to your application's Gemfile:
gem 'apiverve_contentfilter'
And then execute:
$ bundle install
Or install it yourself as:
$ gem install apiverve_contentfilter
Getting Started
Get your API key at APIVerve
Basic Usage
require 'apiverve_contentfilter'
# Initialize the client
client = APIVerve::Contentfilter::Client.new(api_key: "YOUR_API_KEY")
# Make a request
response = client.execute({ url: "https://www.pornhub.com/video/123" })
# Print the response
puts response
Error Handling
begin
response = client.execute({ url: "https://www.pornhub.com/video/123" })
puts response["data"]
rescue APIVerve::Contentfilter::ValidationError => e
puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Contentfilter::APIError => e
puts "API error: #{e.}"
puts "Status code: #{e.status_code}"
end
Debug Mode
# Enable debug logging
client = APIVerve::Contentfilter::Client.new(
api_key: "YOUR_API_KEY",
debug: true
)
Example Response
{
"status": "ok",
"error": null,
"data": {
"url": "https://www.pornhub.com/video/123",
"domain": "www.pornhub.com",
"isBlocked": true,
"category": "porn",
"matchedDomain": "pornhub.com",
"safetyRating": "unsafe"
}
}
Documentation
For more information, visit the API Documentation.
Support
- Website: https://apiverve.com/marketplace/contentfilter?utm_source=ruby&utm_medium=readme
- Email: hello@apiverve.com
License
This gem is available under the MIT License.