Skip to content

Commit

Permalink
📝 update README
Browse files Browse the repository at this point in the history
  • Loading branch information
mtfum committed Jul 31, 2021
1 parent 1143721 commit 7c1ca2c
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,31 @@ let client = NewsAPI(apiKey: "YOUR_API_KEY")
### Get Sources

```Swift
let articles = try await client.getSources()
let articles = try await client.getSources(
sources: [String] = [], // abc-news, bbc-news, etc...
query: String? = nil,
category: NewsSourceCategory? = nil,
language: Language = Language.en
)
```

### Search

```Swift
let articles = try await client.search(query: "bitcoin")
let articles = try await client.search(
query: "",
sources: [String] = [],
sortBy: SortBy? = nil, // relevancy, popularity, publishedAt
language: Language? = nil
)
```

### Top-Headlines

```Swift
let articles = try await client.getTopHeadlines()
let articles = try await client.getTopHeadlines(
category: NewsSourceCategory? = nil,
language: Language? = nil,
country: Country? = nil
)
```

0 comments on commit 7c1ca2c

Please sign in to comment.