该操作允许使用关键字搜索项目。可以以完整或摘要模式请求项目结果。
https://api.globalgiving.org/api/public/services/search/project
https://api.globalgiving.org/api/public/services/search/project/总结
可以对搜索结果进行过滤主题和/或国家.结果集仅限于a最大每个请求有10个结果。如果需要10个以上的结果,请调整开始查询字符串参数以对结果进行分页。的指示,这是一个不安全的请求“公共/”元素,因此,不需要访问令牌(身份验证)。
得到
xml、json
xml、json
https://api.globalgiving.org/api/public/services/search/projects
或
https://api.globalgiving.org/api/public/services/search/projects/summary
api_key在API密匙部分,需要
问指示要使用的搜索查询(必须是URL编码),需要
注意:使用查询值*(即。Q =*)将根据提供的任何过滤器获得所有项目
开始指示结果集的起始位置(默认为0),可选
过滤器用冒号分隔的一个或多个键值对,表示要使用的过滤器及其值,例如,过滤器=主题:edu或过滤器=国家:、可选
要有多个过滤器,用逗号分隔,例如:过滤器=国家:= edu,主题
的可接受值国家过滤器是ISO 3166国家代码特定国家的标识符。
的可接受值主题筛选器返回的是获取全球捐助主题请求。
/ api /公共/服务/搜索/项目?巴基斯坦api_key = YOUR_API_KEY&q = +洪水
提示:
从搜索返回的项目只包括active = true的项目
看到项目响应文件
curl -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET "https://api.globalgiving.org/api/public/services/search/projects?api_key=YOUR_API_KEY&q=pakistan+flood&filter=theme:disaster"
<?xml版本="1.0" encoding="UTF-8" standalone="yes"?> theme disaster pakistan flood
0 false true 它将为200个家庭提供创收机会。减少贫困和隐居,准备洪水灾害。 //www.tuuhangaido.com/pfil/5182/projdoc.doc 2010-04-14T15:16:56-07:00 At。: Manikpur Musaharnia P.O.- Andauli, Sitamarhi India bgvpsitamarhi@gmail.com Ramachandra Rai 9431426288 843324 contactPhone> 843324 Bihar India 50 为穷人提供一个teal stall 100 向穷人提供自行车修理材料 150 向穷人提供一辆自行车黄包车供自己生活 8000 提供1艘船,10件救生衣和2个粮库,2个饲料库,100片氯片到100个家庭用于救济和恢复 24750 将完全资助这个项目 0.00 24750.00 5182 17 //www.tuuhangaido.com/pfil/5182/pict.jpg //www.tuuhangaido.com/pfil/5182/pict_grid1.jpg //www.tuuhangaido.com/pfil/5182/pict_thumbnail.jpg //www.tuuhangaido.com/pfil/5182/pict_med.jpg //www.tuuhangaido.com/pfil/5182/pict_grid7.jpg //www.tuuhangaido.com/pfil/5182/pict_large.jpg //www.tuuhangaido.com/pfil/5182/pict_original.jpg The Image Title
IN Income generation activity will lead to the economic empowerment, social security and stability.P reparedness for disaster lead to lesser impact of the disaster in coming years. More than 500 people will be benefitted by the relief and rehabilitation Poverty, Reclusion, Health diability, lack of income generating oppurtunities, lack of sanitation are being faced by the villagers due to the occurence of flood 0 Village Manikpur, Musharnia, PO Andauli, District Sitamarhi Manikpur India 2848 Bihar Gram Vikas Parishad Sitamarhi 843324 //www.tuuhangaido.com/projects/flood-rehabilitation-relief-and-preparedness/updates/ //www.tuuhangaido.com/projects/flood-rehabilitation-relief-and-preparedness/ Asia and Oceania 24750.00 active Relief and Rehabilitation of the Flood victims. Making the community prepared on flood Disaster and initiate income generating activity in the flood affected villages Disaster Recovery Flood Rehabilitation: Relief and Preparedness
. . ......
注意:<项目>父元素的子元素<项目>如果有多个结果可用,则重复。
搜索 |
|
元素 | 强制性的 | 描述 |
---|---|---|
请求->过滤器->过滤器->名称 | 可选 | 提供的筛选器参数的名称,有效值:[theme, country]。 |
请求->过滤器->过滤器->值 | 可选 | 提供的筛选器参数的值。 |
问 | 要求 | “q”查询字符串参数,表示发送的关键字。 |
请求-> start | 要求 | “start”查询字符串参数,表示在何处启动结果集。 |
总结 | 要求 | true表示以Summary模式返回项目结果。false表示Full模式。 |
Response -> start | 要求 | 结果从哪里开始。 |
response -> numberFound | 要求 | 发现的结果的数量。 |
响应->项目->项目 | 可选 | 参见元素定义获得所有项目的响应 |