{"id":19755735,"url":"https://github.com/fofapro/fofa-c","last_synced_at":"2025-08-27T11:18:56.438Z","repository":{"id":78800938,"uuid":"73889071","full_name":"fofapro/fofa-c","owner":"fofapro","description":null,"archived":false,"fork":false,"pushed_at":"2016-11-16T09:56:46.000Z","size":1597,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-28T09:10:01.183Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","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/fofapro.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-16T06:01:09.000Z","updated_at":"2021-09-27T13:33:15.000Z","dependencies_parsed_at":"2023-07-12T13:15:08.392Z","dependency_job_id":null,"html_url":"https://github.com/fofapro/fofa-c","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fofapro/fofa-c","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-c","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-c/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-c/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-c/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fofapro","download_url":"https://codeload.github.com/fofapro/fofa-c/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fofapro%2Ffofa-c/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272325412,"owners_count":24914642,"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-08-27T02:00:09.397Z","response_time":76,"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":[],"created_at":"2024-11-12T03:12:56.671Z","updated_at":"2025-08-27T11:18:56.428Z","avatar_url":"https://github.com/fofapro.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# FOFA Pro SDK 使用说明文档\n## FOFA Pro API   \n\u003ca href=\"https://fofa.so/api\"\u003e\u003cfont face=\"menlo\"\u003e`FOFA Pro API`\u003c/font\u003e\u003c/a\u003e 是资产搜索引擎 \u003ca href=\"https://fofa.so/\"\u003e`FOFA Pro`\u003c/a\u003e 为开发者提供的 `RESTful API` 接口, 允许开发者在自己的项目中集成 `FOFA Pro` 的功能。    \n\n\n## FOFA SDK\n基于 `FOFA Pro API` 编写的 `C\\C++` 版 `SDK`, 方便 `C\\C++` 开发者快速将 `FOFA Pro` 集成到自己的项目中。\n## 环境\n### 开发环境\n``` zsh\nOS：Windows 10\nIDE: Visual Studio 2012\nCMake Version：3.6.3\n开发语言：C\n```\n### 测试环境\n``` zsh\n操作系统：Windows 10\nIDE: Visual Studio 2012、Visual Studio 2013\nCMake Version：3.6.3\n测试语言：C\\C++\n```\n### 使用环境\n```zsh\nOS: Windows\nCMake Version：3.6及以上\n```\n\n## 获取\n### FOFA SDK\n\u003cstrong\u003e下载 `FOFA SDK` \u003c/strong\u003e   \n``` zsh\ngit clone https://github.com/fofapro/fofa-c.git\n``` \n或访问\u003ca href=\"https://github.com/fofapro/fofa-c\"\u003e`https://github.com/fofapro/fofa-c`\u003c/a\u003e进行下载\n\n\u003cstrong\u003e构建\u003c/strong\u003e  \t\nWindows下使用`命令提示符`进入FOFA Pro SDK源文件根目录，执行`cmake .`,生成工程文件\n\n\u003cstrong\u003e编译\u003c/strong\u003e      \n打开生成文件`FOFA.sln`，执行编译，生成`fofa.lib`。\n`fofa.lib`默认生成路径为`./api/build`\n\n\u003cstrong\u003e使用\u003c/strong\u003e   \n将编译生成的`fofa.lib`放入创建的工程文件夹，将FOFA源码文件夹中的`include`文件夹和`lib`文件夹拷贝至创建的工程文件夹，\n设置相关文件夹路径，即可使用SDK。\n\n## 依赖\n### Email \u0026 API Key   \n| `Email` |用户登陆 `FOFA Pro` 使用的 `Email`|\n|---------|:-----------------:|\n|`Key`| 前往 \u003ca href=\"https://fofa.so/my/users/info\" style=\"color:#0000ff\"\u003e\u003cstrong\u003e`个人中心`\u003c/strong\u003e\u003c/a\u003e 查看 `API Key` |\n\n## Example   \n``` C\n#include \"include/fofa.h\"\n\n#pragma comment(lib,\"fofa.lib\")\n\nint main(int argc,char *argv[])\n{\n\n\tFofaClientPtr test_client_ptr = NULL;\n\tchar *email = \"FOFA_EAMIL@email.com\";\n\tchar *key = \"FOFA_KEY\";\n\tchar *query_result = NULL;\n\tint i,j;\n\tResultPtr result;\n\tfofa_new_client(email, key, \u0026test_client_ptr);\n\t//以原始JSON格式字符串进行查询\n\tfofa_query_as_json(\"domain:\\\"fofa.so\\\"\", \"ip,domain,host,title\", 1, test_client_ptr, \u0026query_result);\n\tprintf(\"%s\\n\",query_result);\n\n\tfree(query_result);\n\tquery_result = NULL;\n\t\n    //获取JSON内数据的方式进行查询\n\tresult = fofa_query_as_array(\"domain=\\\"fofa.so\\\"\", \"ip,host,title\", 1, test_client_ptr, \u0026query_result);\n\t\n\tfree(query_result);\n\tquery_result = NULL;\n\n\tif(result != NULL)\n\t{\n\t\tfor(i = 0;i \u003c result-\u003enum;i++)\n\t\t{\n\t\t\tprintf(\"No:%d:[\",i);\n\t\t\tfor(j = 0;j \u003c result-\u003eitems[i].num;j++)\n\t\t\t{\n\t\t\t\tprintf(\"%s,\",result-\u003eitems[i].member[j]);\n\t\t\t}\n\t\t\tprintf(\"]\\n\");\n\t\t}\n\t\tfofa_destroy_result_struct(result);\n\t\tfree(test_client_ptr);\n\t}\n\n\tsystem(\"pause\");\n\treturn 0;\n}\n```\n\n## FOFA Tool   \n使用`FOFA SDK` 开发的控制台程序,无需登陆即可进行`FOFA`查询.    \n\n\n## 协议\n`FOFA SDK` 遵循 `MIT` 协议 \u003ca href=\"https://opensource.org/licenses/mit\"\u003e\u003cfont face=\"menlo\"\u003ehttps://opensource.org/licenses/mit\u003c/font\u003e\u003c/a\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffofapro%2Ffofa-c","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffofapro%2Ffofa-c","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffofapro%2Ffofa-c/lists"}