{"id":25898112,"url":"https://github.com/forward3d/sogou-search-api","last_synced_at":"2025-10-09T18:16:07.268Z","repository":{"id":52417964,"uuid":"122964448","full_name":"forward3d/sogou-search-api","owner":"forward3d","description":"Sogou search API ruby client gem","archived":false,"fork":false,"pushed_at":"2022-09-29T09:55:13.000Z","size":73,"stargazers_count":4,"open_issues_count":4,"forks_count":3,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-09-21T10:48:20.495Z","etag":null,"topics":["ppc","ruby","sogou","sogou-search"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/forward3d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-26T12:07:25.000Z","updated_at":"2024-12-05T08:23:27.000Z","dependencies_parsed_at":"2022-08-21T01:20:31.728Z","dependency_job_id":null,"html_url":"https://github.com/forward3d/sogou-search-api","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/forward3d/sogou-search-api","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forward3d%2Fsogou-search-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forward3d%2Fsogou-search-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forward3d%2Fsogou-search-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forward3d%2Fsogou-search-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/forward3d","download_url":"https://codeload.github.com/forward3d/sogou-search-api/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/forward3d%2Fsogou-search-api/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278903042,"owners_count":26065786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ppc","ruby","sogou","sogou-search"],"created_at":"2025-03-03T00:17:01.207Z","updated_at":"2025-10-09T18:16:07.240Z","avatar_url":"https://github.com/forward3d.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Sogou Search API\n\nA Client GEM for [Sogou Search API](http://apihome.sogou.com/document/ss/doc1-1.jsp)\n\n## Alpha\n\nThis library is in Alpha. We will make an effort to support the library, but we reserve the right to make incompatible\nchanges when necessary.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'sogou-search-api'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install sogou-search-api\n\n## Usage\n\n### Basic usage\n\nTo use an API, instantiate the service. For example to use the Campaign API:\n\n```ruby\nrequire 'sogou/search/api/auth'\nrequire 'sogou/search/api/service/account'\nrequire 'sogou/search/api/service/plan'\n\n#\n# Set your Sogou api credentials to ENVs\n#\n# ENV['SOGOU_API_TOKEN'] = 'xxxx'\n# ENV['SOGOU_USERNAME'] = 'xxxx'\n# ENV['SOGOU_PASSWORD'] = 'xxxx'\n\ninclude Sogou::Search::Api\n\naccount = Service::Account.new\naccount.authorization = Auth.get_application_default\naccount.get_account_info(options: { convert_regions_to_string: true }) do |result, err|\n  if err != nil\n    p err\n  else\n    p result\n  end\nend\n\n```\n\n### Callbacks\n\nA block can be specified when making calls. If present, the block will be called with the result or error, rather than\nreturning the result from the call or raising the error. Example:\n\n```ruby\n# Read account info\naccount.get_account_info(options: { convert_regions_to_string: true }) do |result, err|\n  if err\n    # Handle error\n  else\n    # Handle response\n  end\nend\n```\n\n### Authorization using environment variables\n\nThe [Sogou Search API Auth](https://github.com/forward3d/sogou-search-api/blob/master/lib/sogou/search/api/auth.rb) also supports authorization via environment variables. Simply set the following variables\nfor your application:\n\n```sh\nSOGOU_API_TOKEN=\"YOUR SOGOU DEVELOPER API TOKEN\"\nSOGOU_USERNAME=\"YOUR SOGOU USERNAME\"\nSOGOU_PASSWORD=\"YOUR SOGOU PASSWORD\"\n```\n\n### Env\n\nThere are two ways to set the environment. One is `ENV['ENV']` environment variable. Another is service attribute.\nIf service attribute is set, environment variable will be ignored.\n\n```ruby\naccount = Service::Account.new\naccount.env = 'production'\n```\n\n## Logging\n\nThe client includes a `Logger` instance that can be used to capture debugging information.\n\nTo set the logging level for the client:\n\n```ruby\nSogou::Search::Api.logger.level = Logger::DEBUG\n```\n\nWhen running in a Rails environment, the client will default to using `::Rails.logger`. If you\nprefer to use a separate logger instance for API calls, this can be changed via one of two ways.\n\nThe first is to provide a new logger instance:\n\n```ruby\nSogou::Search::Api.logger = Logger.new(STDERR)\n```\n\n## License\n\nThis library is licensed under Apache 2.0. Full license text is available in [LICENSE](LICENSE).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/forward3d/sogou-search-api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\nWe encourage contributors to follow [Bozhidar's ruby style guide](https://github.com/bbatsov/ruby-style-guide) in this project.\n\nPull requests (with tests) are appreciated. Please help with:\n\n* Reporting bugs\n* Suggesting features\n* Writing or improving documentation\n* Fixing typos\n* Cleaning whitespace\n* Refactoring code\n* Adding tests\n\nIf you report a bug and don't include a fix, please include a failing test.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforward3d%2Fsogou-search-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fforward3d%2Fsogou-search-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fforward3d%2Fsogou-search-api/lists"}