Skip to content

Commit 040f31d

Browse files
feat(api): api update
1 parent fb014e3 commit 040f31d

3 files changed

Lines changed: 27 additions & 3 deletions

File tree

‎.stats.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 38
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-2f28cd1bf5b88305989d68dc55037fe25bdba2800d61c071a848cc1eb1ccb225.yml
3-
openapi_spec_hash: 6dd2807c7804e08c1d49479c0ff82e47
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/context-dev/context.dev-c1b6ca84f9bec1b1936cebb61f058924c3d7a5f6977e4cd76cf0544c4c7d8737.yml
3+
openapi_spec_hash: 141bfa8430ddccfb5a37c4bd703d163b
44
config_hash: bff282047fafdad771fb7ec685f56944

‎src/context/dev/resources/web.py‎

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,6 +2047,18 @@ def web_scrape_md(
20472047
responses from a recognized API key; use error_code to distinguish stable
20482048
failure categories.
20492049
2050+
### YouTube
2051+
2052+
YouTube URLs return the video or channel itself rather than the surrounding
2053+
player and navigation chrome. A URL addressing a single video (`/watch`,
2054+
`youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration,
2055+
view count, keywords, full description, and the transcript when the video has
2056+
captions that can be retrieved; videos without captions return everything except
2057+
the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`)
2058+
returns its name, handle, subscriber count, video count, and full description.
2059+
When `includeImages=true`, video responses also include the thumbnail and
2060+
channel responses include the avatar. Costs the same as any other scrape.
2061+
20502062
### Billing & errors
20512063
20522064
| HTTP status | Billed? | Meaning |
@@ -4259,6 +4271,18 @@ async def web_scrape_md(
42594271
responses from a recognized API key; use error_code to distinguish stable
42604272
failure categories.
42614273
4274+
### YouTube
4275+
4276+
YouTube URLs return the video or channel itself rather than the surrounding
4277+
player and navigation chrome. A URL addressing a single video (`/watch`,
4278+
`youtu.be`, `/shorts`, `/embed`, `/live`) returns its title, channel, duration,
4279+
view count, keywords, full description, and the transcript when the video has
4280+
captions that can be retrieved; videos without captions return everything except
4281+
the transcript. A channel URL (`/channel/UC…`, `/@handle`, `/c/…`, `/user/…`)
4282+
returns its name, handle, subscriber count, video count, and full description.
4283+
When `includeImages=true`, video responses also include the thumbnail and
4284+
channel responses include the avatar. Costs the same as any other scrape.
4285+
42624286
### Billing & errors
42634287
42644288
| HTTP status | Billed? | Meaning |

‎src/context/dev/types/web_search_response.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
class ResultMarkdown(BaseModel):
1212
"""Markdown scrape status and content for this result."""
1313

14-
code: Literal["SUCCESS", "NOT_REQUESTED", "TIMEOUT", "WEBSITE_ACCESS_ERROR", "ERROR"]
14+
code: Literal["SUCCESS", "NOT_REQUESTED", "TIMEOUT", "CONTENT_TOO_LARGE", "WEBSITE_ACCESS_ERROR", "ERROR"]
1515
"""Per-result scrape outcome. Inspect this before reading `markdown`."""
1616

1717
markdown: Optional[str] = None

0 commit comments

Comments
 (0)