编辑
2025-07-02
我做产品
00

目录

API格式
FastGPT 配置

API获取无版权无水印的图片


在做科技新闻时候需要一张封面图,这里找到一个可以获取无版权图片的API:pexels:

请勿滥用API。默认情况下,API的速率限制为每小时200个请求和每月 20000个请求。你可以联系我们,申请提高此限额,但请提供示例,或做好准备提供演示文件,确保清晰展示你使用API时已注明归属。如果你符合我们的API条款,则可以免费获得无限次请求。

这个额度是够够的,这里记录下

API格式

GET
curl -X GET \ "https://api.pexels.com/v1/search?query=YOUR_QUERY_VALUE&per_page=50&orientation=landscape" \ -H "Authorization: --" \

这里我用的是按关键词搜索图片,之前是热门图片随机选一个,但这这的热门图片跟新的比较慢;orientation 这个参数挺好,可以选择横竖方向

参数名类型是否必填描述/备注
querystring必填搜索查询关键词。例如:"Ocean" (海洋)、"Tigers" (老虎) 等。
orientationstring可选期望的照片方向。可选值:landscape (横向), portrait (纵向), square (正方形)。
sizestring可选最小照片尺寸。可选值:large (约24MP), medium (约12MP), small (约4MP)。
colorstring可选期望的照片颜色。可选值:red, orange, yellow 等预定义颜色,或任何十六进制颜色代码 (例如 #ffffff)。
localestring可选搜索的语言环境。具体支持的语言环境请参考 Pexels 官方文档。
pageinteger可选请求的页码。默认值:1
per_pageinteger可选每页返回的结果数量。默认值:15,最大值:80

FastGPT 配置

图片.png

复制导入即可,

json
{"nodes":[{"nodeId":"pluginInput","name":"workflow:template.plugin_start","intro":"workflow:intro_plugin_input","avatar":"core/workflow/template/workflowStart","flowNodeType":"pluginInput","showStatus":false,"position":{"x":-749.7759166230271,"y":-139.38774480779273},"version":"481","inputs":[],"outputs":[]},{"nodeId":"pluginOutput","name":"common:core.module.template.self_output","intro":"workflow:intro_custom_plugin_output","avatar":"core/workflow/template/pluginOutput","flowNodeType":"pluginOutput","showStatus":false,"position":{"x":2271.224083376973,"y":-337.3877448077927},"version":"481","inputs":[{"renderTypeList":["reference"],"valueType":"string","canEdit":true,"key":"图片地址","label":"图片地址","isToolOutput":true,"description":"","required":true,"value":["tw2nb6umKVlJOd6Z","erqzi6Id9qNIXeGS"]},{"renderTypeList":["reference"],"valueType":"arrayString","canEdit":true,"key":"地址数组","label":"地址数组","isToolOutput":true,"description":"","required":true,"value":[["wNp0yak88GcQXoQv","数组"]]},{"renderTypeList":["reference"],"valueType":"string","canEdit":true,"key":"随机一个","label":"随机一个","isToolOutput":true,"description":"","required":true,"value":["kOcxMMVf32NBeL8M","qLUQfhG0ILRX"]}],"outputs":[]},{"nodeId":"pluginConfig","name":"common:core.module.template.system_config","intro":"","avatar":"core/workflow/template/systemConfig","flowNodeType":"pluginConfig","position":{"x":-520.2483102852332,"y":-712.6924771283639},"version":"4811","inputs":[],"outputs":[]},{"nodeId":"tw2nb6umKVlJOd6Z","name":"HTTP 请求","intro":"可以发出一个 HTTP 请求,实现更为复杂的操作(联网搜索、数据库查询等)","avatar":"core/workflow/template/httpRequest","flowNodeType":"httpRequest468","showStatus":true,"position":{"x":262.2240833769729,"y":-565.8877448077927},"version":"481","inputs":[{"key":"system_addInputParam","renderTypeList":["addInputParam"],"valueType":"dynamic","label":"","required":false,"description":"common:core.module.input.description.HTTP Dynamic Input","customInputConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":true},"valueDesc":"","debugLabel":"","toolDescription":""},{"key":"system_httpMethod","renderTypeList":["custom"],"valueType":"string","label":"","value":"GET","required":true,"valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"key":"system_httpTimeout","renderTypeList":["custom"],"valueType":"number","label":"","value":30,"min":5,"max":600,"required":true,"valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"key":"system_httpReqUrl","renderTypeList":["hidden"],"valueType":"string","label":"","description":"common:core.module.input.description.Http Request Url","placeholder":"https://api.ai.com/getInventory","required":false,"value":"https://api.pexels.com/v1/search","valueDesc":"","debugLabel":"","toolDescription":""},{"key":"system_httpHeader","renderTypeList":["custom"],"valueType":"any","value":[{"key":"Authorization","value":"---","type":"string"}],"label":"","description":"common:core.module.input.description.Http Request Header","placeholder":"common:core.module.input.description.Http Request Header","required":false,"valueDesc":"","debugLabel":"","toolDescription":""},{"key":"system_httpParams","renderTypeList":["hidden"],"valueType":"any","value":[{"key":"query","value":"{{$tw2nb6umKVlJOd6Z.query$}}","type":"string"},{"key":"per_page","value":"50","type":"string"},{"key":"orientation ","type":"string","value":"landscape"}],"label":"","required":false,"valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"key":"system_httpJsonBody","renderTypeList":["hidden"],"valueType":"any","label":"","required":false,"valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"key":"system_httpFormBody","renderTypeList":["hidden"],"valueType":"any","value":[],"label":"","required":false,"valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"key":"system_httpContentType","renderTypeList":["hidden"],"valueType":"string","value":"json","label":"","required":false,"valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"renderTypeList":["reference"],"valueType":"string","canEdit":true,"key":"query","label":"query","customInputConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":true},"required":true,"value":["y0a8eGqMiV881Fwk","qLUQfhG0ILRX"]}],"outputs":[{"id":"error","key":"error","label":"请求错误","description":"HTTP请求错误信息,成功时返回空","valueType":"object","type":"static","valueDesc":""},{"id":"httpRawResponse","key":"httpRawResponse","required":true,"label":"原始响应","description":"HTTP请求的原始响应。只能接受字符串或JSON类型响应数据。","valueType":"any","type":"static","valueDesc":""},{"id":"system_addOutputParam","key":"system_addOutputParam","type":"dynamic","valueType":"dynamic","label":"输出字段提取","customFieldConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":false},"description":"可以通过 JSONPath 语法来提取响应值中的指定字段","valueDesc":""},{"id":"erqzi6Id9qNIXeGS","valueType":"string","type":"dynamic","key":"$.photos[*].src.large","label":"$.photos[*].src.large"}]},{"nodeId":"wNp0yak88GcQXoQv","name":"json-返回数组","intro":"","avatar":"core/app/type/pluginFill","flowNodeType":"pluginModule","showStatus":true,"position":{"x":1000.2240833769729,"y":-116.88774480779273},"version":"67d6ebf096d118127c98357d","inputs":[{"key":"system_forbid_stream","renderTypeList":["switch"],"valueType":"boolean","label":"禁用流输出","description":"强制设置嵌套运行的应用,均以非流模式运行","value":false,"valueDesc":"","debugLabel":"","toolDescription":""},{"renderTypeList":["reference"],"selectedTypeIndex":0,"valueType":"string","canEdit":false,"key":"json","label":"json","description":"","defaultValue":"","list":[{"label":"","value":""}],"maxFiles":5,"canSelectFile":true,"canSelectImg":true,"required":true,"value":["tw2nb6umKVlJOd6Z","erqzi6Id9qNIXeGS"],"valueDesc":"","debugLabel":"","toolDescription":""}],"outputs":[{"id":"数组","type":"static","key":"数组","valueType":"arrayString","label":"数组","description":"","valueDesc":""}],"pluginId":"67acb78e8054db1ced7fd48c"},{"nodeId":"kOcxMMVf32NBeL8M","name":"代码运行","intro":"执行一段简单的脚本代码,通常用于进行复杂的数据处理。","avatar":"core/workflow/template/codeRun","flowNodeType":"code","showStatus":true,"position":{"x":1644.2240833769729,"y":-83.88774480779273},"version":"482","inputs":[{"key":"system_addInputParam","renderTypeList":["addInputParam"],"valueType":"dynamic","label":"","required":false,"description":"workflow:these_variables_will_be_input_parameters_for_code_execution","customInputConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":true},"valueDesc":"","debugLabel":"","toolDescription":""},{"key":"codeType","renderTypeList":["hidden"],"label":"","valueType":"string","value":"js","valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"key":"code","renderTypeList":["custom"],"label":"","valueType":"string","value":"function main({data1}){\n const randomElement = data1[Math.floor(Math.random() * data1.length)];\n return {\n result: randomElement,\n }\n}","valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"renderTypeList":["reference"],"valueType":"arrayString","canEdit":true,"key":"data1","label":"data1","customInputConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":true},"required":true,"value":[["wNp0yak88GcQXoQv","数组"]],"valueDesc":"","description":"","debugLabel":"","toolDescription":""}],"outputs":[{"id":"system_rawResponse","key":"system_rawResponse","label":"完整响应数据","valueType":"object","type":"static","valueDesc":"","description":""},{"id":"error","key":"error","label":"运行错误","description":"代码运行错误信息,成功时返回空","valueType":"object","type":"static","valueDesc":""},{"id":"system_addOutputParam","key":"system_addOutputParam","type":"dynamic","valueType":"dynamic","label":"","customFieldConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":false},"description":"将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key","valueDesc":""},{"id":"qLUQfhG0ILRX","type":"dynamic","key":"result","valueType":"string","label":"result","valueDesc":"","description":""}]},{"nodeId":"y0a8eGqMiV881Fwk","name":"随机关键词","intro":"执行一段简单的脚本代码,通常用于进行复杂的数据处理。","avatar":"core/workflow/template/codeRun","flowNodeType":"code","showStatus":true,"position":{"x":-257.7759166230271,"y":-402.8877448077927},"inputs":[{"key":"system_addInputParam","renderTypeList":["addInputParam"],"valueType":"dynamic","label":"","required":false,"description":"workflow:these_variables_will_be_input_parameters_for_code_execution","customInputConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":true},"valueDesc":"","debugLabel":"","toolDescription":""},{"key":"codeType","renderTypeList":["hidden"],"label":"","valueType":"string","value":"js","valueDesc":"","description":"","debugLabel":"","toolDescription":""},{"key":"code","renderTypeList":["custom"],"label":"","valueType":"string","value":"const keywords = [\n \"Technology\",\n \"Innovation\",\n \"Science\",\n \"Artificial Intelligence\",\n \"Sustainability\",\n \"Data Science\", // 新增\n \"Research\", // 新增\n \"Automation\", // 新增\n \"Bioengineering\", // 新增\n \"Quantum\" // 新增\n];\nfunction main({data1, data2}){\n const numberOfKeywords = keywords.length; // 在本例中为 10\n // 3. 生成一个随机索引\n const randomIndex = Math.floor(Math.random() * numberOfKeywords);\n // 4. 根据随机索引获取关键词\n const selectedKeyword = keywords[randomIndex];\n return {result:selectedKeyword};\n}\n\n","valueDesc":"","description":"","debugLabel":"","toolDescription":""}],"outputs":[{"id":"system_rawResponse","key":"system_rawResponse","label":"完整响应数据","valueType":"object","type":"static","valueDesc":"","description":""},{"id":"error","key":"error","label":"运行错误","description":"代码运行错误信息,成功时返回空","valueType":"object","type":"static","valueDesc":""},{"id":"system_addOutputParam","key":"system_addOutputParam","type":"dynamic","valueType":"dynamic","label":"","customFieldConfig":{"selectValueTypeList":["string","number","boolean","object","arrayString","arrayNumber","arrayBoolean","arrayObject","arrayAny","any","chatHistory","datasetQuote","dynamic","selectDataset","selectApp"],"showDescription":false,"showDefaultValue":false},"description":"将代码中 return 的对象作为输出,传递给后续的节点。变量名需要对应 return 的 key","valueDesc":""},{"id":"qLUQfhG0ILRX","type":"dynamic","key":"result","valueType":"string","label":"result","valueDesc":"","description":""}]}],"edges":[{"source":"tw2nb6umKVlJOd6Z","target":"pluginOutput","sourceHandle":"tw2nb6umKVlJOd6Z-source-right","targetHandle":"pluginOutput-target-left"},{"source":"tw2nb6umKVlJOd6Z","target":"wNp0yak88GcQXoQv","sourceHandle":"tw2nb6umKVlJOd6Z-source-right","targetHandle":"wNp0yak88GcQXoQv-target-left"},{"source":"wNp0yak88GcQXoQv","target":"pluginOutput","sourceHandle":"wNp0yak88GcQXoQv-source-right","targetHandle":"pluginOutput-target-left"},{"source":"wNp0yak88GcQXoQv","target":"kOcxMMVf32NBeL8M","sourceHandle":"wNp0yak88GcQXoQv-source-right","targetHandle":"kOcxMMVf32NBeL8M-target-left"},{"source":"kOcxMMVf32NBeL8M","target":"pluginOutput","sourceHandle":"kOcxMMVf32NBeL8M-source-right","targetHandle":"pluginOutput-target-left"},{"source":"pluginInput","target":"y0a8eGqMiV881Fwk","sourceHandle":"pluginInput-source-right","targetHandle":"y0a8eGqMiV881Fwk-target-left"},{"source":"y0a8eGqMiV881Fwk","target":"tw2nb6umKVlJOd6Z","sourceHandle":"y0a8eGqMiV881Fwk-source-right","targetHandle":"tw2nb6umKVlJOd6Z-target-left"}],"chatConfig":{"welcomeText":"","variables":[],"questionGuide":{"open":false,"model":"gpt-4o-mini","customPrompt":""},"ttsConfig":{"type":"web"},"whisperConfig":{"open":false,"autoSend":false,"autoTTSResponse":false},"chatInputGuide":{"open":false,"textList":[],"customUrl":""},"instruction":"","autoExecute":{"open":false,"defaultPrompt":""},"_id":"684158be6c34053cae1c4503"}}
如果对你有用的话,可以打赏哦
打赏
ali pay
wechat pay

本文作者:没想好

本文链接:

版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!