mirror of
https://github.com/minoplhy/duckduckgo-images-api.git
synced 2024-11-14 15:46:55 +00:00
39 lines
941 B
Markdown
39 lines
941 B
Markdown
|
# DuckDuckGo-image-api
|
||
|
|
||
|
This project is Go adaptation of Python3 forked [duckduckgo-image-api](https://github.com/joeyism/duckduckgo-images-api) . I made this modules because this module will be need in my future project .
|
||
|
|
||
|
Contribution are always welcome
|
||
|
|
||
|
# How to use
|
||
|
|
||
|
Import
|
||
|
|
||
|
# Example Use Cases
|
||
|
|
||
|
#### Get Search Results
|
||
|
```
|
||
|
func main() {
|
||
|
hunsen := goduckgo.Search(goduckgo.Query{Keyword: "duck"})
|
||
|
fmt.Print(hunsen.Results)
|
||
|
}
|
||
|
|
||
|
```
|
||
|
#### Get Search Result Image
|
||
|
```
|
||
|
func main() {
|
||
|
hunsen := goduckgo.Search(goduckgo.Query{Keyword: "duck"})
|
||
|
for _, somtam := range hunsen.Results {
|
||
|
// This Can be use with all hunsen.Results(or anything.Results depending on your goduckgo.Search)
|
||
|
// e.g. Title or URL depending on what you want
|
||
|
fmt.Println(somtam.Image)
|
||
|
}
|
||
|
}
|
||
|
```
|
||
|
#### Specific P and S
|
||
|
```
|
||
|
func main() {
|
||
|
hunsen := goduckgo.Search(goduckgo.Query{Keyword: "duck", P: "1", S: "200"})
|
||
|
fmt.Print(hunsen.Results)
|
||
|
}
|
||
|
|
||
|
```
|